Changeset 718 for WAeUP_SRP/trunk
- Timestamp:
- 18 Oct 2006, 05:54:58 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Academics.py
r717 r718 24 24 i_home = Globals.INSTANCE_HOME 25 25 26 def makeCertificateCode(code): ###(26 def makeCertificateCode(code): 27 27 code = code.replace('.','') 28 28 code = code.replace('(','') … … 32 32 code = code.replace('_','') 33 33 return code 34 35 ###)36 34 37 35 class AcademicsFolder(CPSDocument): ###( … … 107 105 "bank_code", 108 106 ) 109 format = ' ,'.join(['"%%(%s)s"' % fn for fn in fields])107 format = ' '.join(['%%(%s)s ' % fn for fn in fields]) 110 108 for faculty in faculties: 111 109 processing = "processing %s" % format … … 141 139 "faculty_code", 142 140 ) 143 format = ' ,'.join(['"%%(%s)s"' % fn for fn in fields])141 format = ' '.join(['%%(%s)s ' % fn for fn in fields]) 144 142 try: 145 143 deps = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb")) … … 202 200 "session", 203 201 ) 204 format = ' ,'.join(['"%%(%s)s"' % fn for fn in fields])202 format = ' '.join(['%%(%s)s ' % fn for fn in fields]) 205 203 try: 206 204 courses = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb")) … … 274 272 "admin_status", 275 273 ) 276 format = ' ,'.join(['"%%(%s)s"' % fn for fn in fields])274 format = ' '.join(['%%(%s)s ' % fn for fn in fields]) 277 275 try: 278 276 courses = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb")) … … 337 335 wf = self.portal_workflow 338 336 no_import_list = [] 339 logger = logging.getLogger('loadcertificate s')337 logger = logging.getLogger('loadcertificatecourses') 340 338 fields = ("code", 341 339 "review_state", … … 347 345 "core_or_elective", 348 346 ) 349 format = ' ,'.join(['"%%(%s)s"' % fn for fn in fields])347 format = ' '.join(['%%(%s)s ' % fn for fn in fields]) 350 348 try: 351 349 cert_courses = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb")) … … 368 366 em = 'CertCode %(certificate_code)s for %(code)s not found\n' % cert_course 369 367 logger.info(em) 370 no_import_list.append(em)371 no_import_list.append(format % cert_course + " \n")368 #no_import_list.append(em) 369 no_import_list.append(format % cert_course + "CertificateCourse\n") 372 370 continue 373 371 certificate = certs[code] … … 376 374 em = 'Course %(code)s for %(certificate_code)s Level %(level)s not found in Courses\n' % cert_course 377 375 logger.info(em) 378 no_import_list.append(em)379 no_import_list.append(format % cert_course + " \n")376 #no_import_list.append(em) 377 no_import_list.append(format % cert_course + "Course\n") 380 378 continue 381 379 if depid not in d_ids: 382 380 em = 'Department %(department_code)s for %(certificate_code)s not found\n' % cert_course 383 381 logger.info(em) 384 no_import_list.append(em)385 no_import_list.append(format % cert_course + " \n")382 #no_import_list.append(em) 383 no_import_list.append(format % cert_course + "Department\n") 386 384 continue 387 385 level = cert_course.get('level') … … 396 394 msg = 'Duplicate %(code)s in Level %(level)s' % cert_course 397 395 logger.info(msg) 398 no_import_list.append(msg + "\n")399 no_import_list.append(format % cert_course + " \n")396 #no_import_list.append(msg + "\n") 397 no_import_list.append(format % cert_course + "duplicate\n") 400 398 continue 401 399 l.invokeFactory('CertificateCourse',course_code)
Note: See TracChangeset for help on using the changeset viewer.