Changeset 1720 for WAeUP_SRP


Ignore:
Timestamp:
28 Apr 2007, 05:14:20 (18 years ago)
Author:
Henrik Bettermann
Message:

generateStudentId changed

Location:
WAeUP_SRP/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r1712 r1720  
    404404            catalog_entry['id'] = sid
    405405            tr_count += 1
    406             logger.info('%(total)s+%(tr_count)s: Creating Student with ID %(sid)s REG-NO %(jamb_reg_no)s ' % vars())
     406            logger.info('%(total)s+%(tr_count)s: Creating Student with ID %(sid)s reg_no %(jamb_reg_no)s ' % vars())
    407407            student = getattr(self,sid)
    408408            student.manage_setLocalRoles(sid, ['Owner',])
     
    620620            catalog_entry['id'] = sid
    621621            tr_count += 1
    622             logger.info('%(total)s+%(tr_count)s: Creating Student with ID %(sid)s REG-NO %(jamb_reg_no)s ' % vars())
     622            logger.info('%(total)s+%(tr_count)s: Creating Student with ID %(sid)s reg_no %(jamb_reg_no)s ' % vars())
    623623            student = getattr(self,sid)
    624624            student.manage_setLocalRoles(sid, ['Owner',])
     
    646646            picture ="%s/import/pictures/%s.jpg" % (i_home,jamb_reg_no)
    647647            app.manage_setLocalRoles(sid, ['Owner',])
    648            
     648
    649649            picture_id = da['jamb_reg_no'].replace('/','_')
    650650            file = None
     
    655655                    break
    656656            if file is not None:
    657            
    658                 ## file conversion does not work           
     657
     658                ## file conversion does not work
    659659                #img = PIL.Image.open(file)
    660660                #img.thumbnail((150,200),
    661661                #              resample=PIL.Image.ANTIALIAS)
    662662                #outfile = StringIO()
    663                 #img.save(outfile, format=img.format)           
     663                #img.save(outfile, format=img.format)
    664664
    665665                outfile = file.read()
  • WAeUP_SRP/trunk/WAeUPTool.py

    r1716 r1720  
    4848        return getattr(object,name)
    4949    return None
    50    
     50
    5151class WAeUPTool(UniqueObject, SimpleItem, ActionProviderBase):
    5252    """WAeUP tool"""
     
    6868        response.write("%s<br />\r\n" % s)
    6969
    70     security.declareProtected(ModifyPortalContent,'openLog') 
     70    security.declareProtected(ModifyPortalContent,'openLog')
    7171    def openLog(self,name):
    7272        """open a log file"""
     
    7979        return log
    8080
    81     security.declareProtected(ModifyPortalContent,'writeLog') 
     81    security.declareProtected(ModifyPortalContent,'writeLog')
    8282    def writeLog(self,logfile,s):
    8383        """write to the log file"""
    8484        logfile.write(s)
    8585
    86        
     86
    8787    def generateStudentId(self,letter): ###(
    8888        import random
     
    9292            letter= r.choice('ABCDEFGHKLMNPQRSTUVWXY')
    9393        sid = "%c%d" % (letter,r.randint(99999,1000000))
    94 ##        students = self.portal_url.getPortalObject().campus.students
    95 ##        while hasattr(students, sid):
     94        students = self.portal_url.getPortalObject().campus.students
     95        while hasattr(students, sid):
     96            sid = "%c%d" % (letter,r.randint(99999,1000000))
     97##        while self.students_catalog(id = sid):
    9698##            sid = "%c%d" % (letter,r.randint(99999,1000000))
    97         while self.students_catalog(id = sid):
    98             sid = "%c%d" % (letter,r.randint(99999,1000000))
    9999        return sid
    100100    ###)
Note: See TracChangeset for help on using the changeset viewer.