Changeset 1601


Ignore:
Timestamp:
19 Mar 2007, 23:00:22 (18 years ago)
Author:
Henrik Bettermann
Message:

csv output format corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r1599 r1601  
    714714
    715715    security.declareProtected(ModifyPortalContent,"fixAllNames")###(
    716     def fixAllNames(self): 
     716    def fixAllNames(self):
    717717        "fix all students names"
    718718        import transaction
     
    731731            old_new = self.fixName(student,student_entry)
    732732            count += 1
    733             response_write(response,"%d) %s: %s" % (count + total,student_entry.id,old_new))
     733            response_write(response,'"%d","%s","%s",' % (count + total,student_entry.id,old_new))
    734734            if count > 2000:
    735735                transaction.commit()
     
    740740
    741741    security.declareProtected(ModifyPortalContent,"fixName")###(
    742     def fixName(self,student_brain, student_entry): 
     742    def fixName(self,student_brain, student_entry):
    743743        "fix the name of a student"
    744744        fix = "first"
     
    746746            return "Name already fixed"
    747747        student_id = student_entry.id
    748         new_student = student_entry.jamb_reg_no.startswith('6') 
     748        new_student = student_entry.jamb_reg_no.startswith('6')
    749749        student_obj = student_brain.getObject()
    750750        personal = getattr(student_obj,'personal',None)
    751751        invalid = ''
    752752        if personal is None:
    753             return '"%s", "Returning: %s","%s"' % (invalid,student_entry.name,"not logged in")
     753            return '"%s","Returning","%s","%s"' % (invalid,student_entry.name,"not logged in")
    754754        per_doc = personal.getContent()
    755755        old_first = per_doc.firstname
     
    784784            if old_first:
    785785                new_last = old_first
    786                    
     786
    787787            if old_first.find('<') != -1 or\
    788788               old_first.find('>') != -1 or\
     
    819819        else:
    820820            text = "Returning"
    821         old_new = '"%s", "%s: %s","%s"' % (invalid,text,
     821        old_new = '"%s","%s","%s","%s"' % (invalid,text,
    822822                                           student_entry.name,
    823823                                           name)
Note: See TracChangeset for help on using the changeset viewer.