Changeset 2979 for WAeUP_SRP/base/skins


Ignore:
Timestamp:
5 Jan 2008, 15:01:33 (17 years ago)
Author:
Henrik Bettermann
Message:

fix fix

Location:
WAeUP_SRP/base/skins/waeup_utilities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_utilities/fix_lgas.py

    r2978 r2979  
    6666logger.info("found %d students" % total)
    6767count = 0
    68 commit_after = 50
    69 logger.info('started to fix %d lga' % total)
     68commit_after = 100
     69logger.info('started to fix %d records in students_catalog' % total)
    7070d,states,lgas = getLGAs()
    7171d = {}
     
    7676        continue
    7777    if student_record.lga.startswith('no state'):
     78        logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id))
    7879        continue
    7980    #rwrite("%s: %s" % (student_record.id,student_record.lga))
    8081    sl = student_record.lga.split('/')
    8182    if len(sl) != 2:
     83        logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id))
    8284        #rwrite("wrong size %s: %s" % (student_record.id,sl))
    8385        continue
     
    8587    lga = sl[1].lower().strip()
    8688    if not lga or not state:
     89        logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id))
    8790        continue
    8891    count += 1
    8992    if len(d) and not len(d)  % commit_after:
    90         logger.info("found %d correct of  %d sofar" % (len(d),count))
     93        logger.info("found %d correct of %d so far" % (len(d),count))
    9194    state_lga = state + '_' + lga
    9295    if state in states:
     
    101104            break
    102105        if found:
    103             msg = "found %s for %s" % (state_lga,student_record.id)
     106            #msg = "found %s for %s" % (state_lga,student_record.id)
    104107            d[student_record.id] = state_lga
    105         else:
    106             msg = "no '%s' '%s' for %s" % (state,lga,student_record.id)
     108        #else:
     109            #msg = "no '%s' '%s' for %s" % (state,lga,student_record.id)
    107110            #rwrite(msg)
    108     else:
    109         msg = "no state '%s' '%s' for %s" % (state,lga,student_record.id)
     111    #else:
     112        #msg = "no state '%s' '%s' for %s" % (state,lga,student_record.id)
    110113        #rwrite(msg)
    111114    # if count > 150:
  • WAeUP_SRP/base/skins/waeup_utilities/ti_441_resolve.py

    r2972 r2979  
    6565student_records = aq_students(query)
    6666total = len(student_records)
    67 logger.info("found %d with empty clearance lga" % total)
     67logger.info("found %d records with empty clearance lga" % total)
    6868count = 0
    69 commit_after = 50
    70 logger.info('started to fix %d lga' % total)
     69commit_after = 100
     70logger.info('started to fix %d records' % total)
    7171d,states,lgas = getLGAs()
    7272d = {}
     
    7474    count += 1
    7575    if len(d) and not len(d)  % commit_after:
    76         logger.info("found %d correct of  %d sofar" % (len(d),count))
     76        logger.info("found %d correct lga values of %d so far" % (len(d),count))
    7777    jamb_state = getattr(getattr(students_folder,student_record.id),'application').getContent().jamb_state
    7878    jamb_lga = getattr(getattr(students_folder,student_record.id),'application').getContent().jamb_lga
     
    8282    if jamb_state and jamb_lga and jamb_state in states and jamb_lga in lgas:
    8383        d[student_record.id] = lga
    84     else:
    85         msg = "no %s for %s" % (lga,student_record.id)
    86         pass
     84    #else:
     85    #    msg = "no %s for %s" % (lga,student_record.id)
     86    #    pass
    8787    # rwrite(msg)
    8888    # if count > 150:
    8989    #     break
    90 logger.info("found %d correct lgas" % len(d))
     90logger.info("found %d correct lga values" % len(d))
    9191edited = 1
    9292for student_id,lga in d.items():
    93     msg = "set clearance.lga to %s for %s" % (lga,student_record.id)
     93    msg = "set clearance.lga to %s for %s" % (lga,student.id)
    9494    getattr(getattr(students_folder,student_id),'clearance').getContent().edit(mapping={'lga':lga})
    9595    logger.info(msg)
Note: See TracChangeset for help on using the changeset viewer.