Changeset 718 for WAeUP_SRP/trunk


Ignore:
Timestamp:
18 Oct 2006, 05:54:58 (18 years ago)
Author:
Henrik Bettermann
Message:

changed format of CertificateCourses_not_imported log file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Academics.py

    r717 r718  
    2424i_home = Globals.INSTANCE_HOME
    2525
    26 def makeCertificateCode(code): ###(
     26def makeCertificateCode(code):
    2727    code = code.replace('.','')
    2828    code = code.replace('(','')
     
    3232    code = code.replace('_','')
    3333    return code
    34 
    35 ###)
    3634
    3735class AcademicsFolder(CPSDocument): ###(
     
    107105                  "bank_code",
    108106                  )
    109         format = ','.join(['"%%(%s)s"' % fn for fn in fields])
     107        format = ' '.join(['%%(%s)s ' % fn for fn in fields])
    110108        for faculty in faculties:
    111109            processing = "processing %s" % format
     
    141139                  "faculty_code",
    142140                  )
    143         format = ','.join(['"%%(%s)s"' % fn for fn in fields])
     141        format = ' '.join(['%%(%s)s ' % fn for fn in fields])
    144142        try:
    145143            deps = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    202200                  "session",
    203201                  )
    204         format = ','.join(['"%%(%s)s"' % fn for fn in fields])
     202        format = ' '.join(['%%(%s)s ' % fn for fn in fields])
    205203        try:
    206204            courses = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    274272                  "admin_status",
    275273                  )
    276         format = ','.join(['"%%(%s)s"' % fn for fn in fields])
     274        format = ' '.join(['%%(%s)s ' % fn for fn in fields])
    277275        try:
    278276            courses = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    337335        wf = self.portal_workflow
    338336        no_import_list = []
    339         logger = logging.getLogger('loadcertificates')
     337        logger = logging.getLogger('loadcertificatecourses')
    340338        fields = ("code",
    341339                  "review_state",
     
    347345                  "core_or_elective",
    348346                  )
    349         format = ','.join(['"%%(%s)s"' % fn for fn in fields])
     347        format = ' '.join(['%%(%s)s ' % fn for fn in fields])
    350348        try:
    351349            cert_courses = csv.DictReader(open("%s/import/%s.csv" % (i_home,name),"rb"))
     
    368366                em = 'CertCode %(certificate_code)s for %(code)s not found\n' % cert_course
    369367                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")
    372370                continue
    373371            certificate = certs[code]
     
    376374                em = 'Course %(code)s for %(certificate_code)s Level %(level)s not found in Courses\n' % cert_course
    377375                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")
    380378                continue
    381379            if depid not in d_ids:
    382380                em = 'Department %(department_code)s for %(certificate_code)s not found\n' % cert_course
    383381                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")
    386384                continue
    387385            level = cert_course.get('level')
     
    396394                msg = 'Duplicate %(code)s in Level %(level)s' % cert_course
    397395                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")
    400398                continue
    401399            l.invokeFactory('CertificateCourse',course_code)
Note: See TracChangeset for help on using the changeset viewer.