- Timestamp:
- 28 Apr 2007, 05:14:20 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r1712 r1720 404 404 catalog_entry['id'] = sid 405 405 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()) 407 407 student = getattr(self,sid) 408 408 student.manage_setLocalRoles(sid, ['Owner',]) … … 620 620 catalog_entry['id'] = sid 621 621 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()) 623 623 student = getattr(self,sid) 624 624 student.manage_setLocalRoles(sid, ['Owner',]) … … 646 646 picture ="%s/import/pictures/%s.jpg" % (i_home,jamb_reg_no) 647 647 app.manage_setLocalRoles(sid, ['Owner',]) 648 648 649 649 picture_id = da['jamb_reg_no'].replace('/','_') 650 650 file = None … … 655 655 break 656 656 if file is not None: 657 658 ## file conversion does not work 657 658 ## file conversion does not work 659 659 #img = PIL.Image.open(file) 660 660 #img.thumbnail((150,200), 661 661 # resample=PIL.Image.ANTIALIAS) 662 662 #outfile = StringIO() 663 #img.save(outfile, format=img.format) 663 #img.save(outfile, format=img.format) 664 664 665 665 outfile = file.read() -
WAeUP_SRP/trunk/WAeUPTool.py
r1716 r1720 48 48 return getattr(object,name) 49 49 return None 50 50 51 51 class WAeUPTool(UniqueObject, SimpleItem, ActionProviderBase): 52 52 """WAeUP tool""" … … 68 68 response.write("%s<br />\r\n" % s) 69 69 70 security.declareProtected(ModifyPortalContent,'openLog') 70 security.declareProtected(ModifyPortalContent,'openLog') 71 71 def openLog(self,name): 72 72 """open a log file""" … … 79 79 return log 80 80 81 security.declareProtected(ModifyPortalContent,'writeLog') 81 security.declareProtected(ModifyPortalContent,'writeLog') 82 82 def writeLog(self,logfile,s): 83 83 """write to the log file""" 84 84 logfile.write(s) 85 85 86 86 87 87 def generateStudentId(self,letter): ###( 88 88 import random … … 92 92 letter= r.choice('ABCDEFGHKLMNPQRSTUVWXY') 93 93 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): 96 98 ## sid = "%c%d" % (letter,r.randint(99999,1000000)) 97 while self.students_catalog(id = sid):98 sid = "%c%d" % (letter,r.randint(99999,1000000))99 99 return sid 100 100 ###)
Note: See TracChangeset for help on using the changeset viewer.