Changeset 2981 for WAeUP_SRP


Ignore:
Timestamp:
6 Jan 2008, 16:05:43 (17 years ago)
Author:
Henrik Bettermann
Message:

split string must be ' / ', not '/'

File:
1 edited

Legend:

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

    r2980 r2981  
    2525import logging
    2626import DateTime
    27 logger = logging.getLogger('Skins.fix_lgas')
     27logger = logging.getLogger('Skins.ti_441_resolve_part2')
    2828from Products.AdvancedQuery import Eq, Between, Le,In
    2929aq_portal = context.portal_catalog_real.evalAdvancedQuery
     
    7171d = {}
    7272for student_record in student_records:
     73    # skip record without lga value
    7374    if not student_record.lga:
    7475        continue
     76    #skip records with correct lga key value
    7577    if student_record.lga.find('_') > -1:
    7678        continue
     
    7981        continue
    8082    #rwrite("%s: %s" % (student_record.id,student_record.lga))
    81     sl = student_record.lga.split('/')
     83    sl = student_record.lga.split(' / ')
    8284    if len(sl) != 2:
    8385        logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id))
     
    9193    count += 1
    9294    if len(d) and not len(d)  % commit_after:
    93         logger.info("found %d correct of %d so far" % (len(d),count))
     95        logger.info("found %d correct state/lga combinations of %d so far" % (len(d),count))
    9496    state_lga = state + '_' + lga
    9597    if state in states:
     
    115117    #     break
    116118to_edit = len(d)
    117 logger.info("found %d correct lgas of %d" % (to_edit,count))
    118 #return
     119logger.info("found %d correct state/lga combinations of %d" % (to_edit,count))
     120return
    119121
    120122edited = 1
Note: See TracChangeset for help on using the changeset viewer.