Index: WAeUP_SRP/base/skins/waeup_utilities/copyLGA.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_utilities/copyLGA.py	(revision 3210)
+++ WAeUP_SRP/base/skins/waeup_utilities/copyLGA.py	(revision 3210)
@@ -0,0 +1,78 @@
+## Script (Python) "copyLGA"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: ti_441_resolve.py 2979 2008-01-05 15:01:33Z henrik $
+"""
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+if str(member) not in ('admin','joachim'):
+    return
+
+
+import logging
+import DateTime
+#logger = logging.getLogger('Skins.ti_441_resolve_part1')
+logger = logging.getLogger('Skins.copyLGA')
+from Products.AdvancedQuery import Eq, Between, Le,In
+aq_portal = context.portal_catalog_real.evalAdvancedQuery
+aq_students = context.students_catalog.evalAdvancedQuery
+students_folder = context.portal_url.getPortalObject().campus.students
+
+request = context.REQUEST
+session = request.SESSION
+response = request.RESPONSE
+setheader = request.RESPONSE.setHeader
+
+re_split = context.waeup_tool.re_split
+query = Eq('lga','')
+student_records = aq_students(query)
+total = len(student_records)
+logger.info("found %d records with empty clearance lga" % total)
+count = 0
+commit_after = 100
+logger.info('started to fix %d records' % total)
+mapping = context.waeup_tool.getStatesLgas()
+states = mapping['states']
+lgas = mapping['lgas']
+words_dict = mapping['word_dict']
+d = {}
+for student_record in student_records:
+    count += 1
+    jamb_state = getattr(getattr(students_folder,student_record.id),'application').getContent().jamb_state
+    jamb_lga = getattr(getattr(students_folder,student_record.id),'application').getContent().jamb_lga
+    words = ' '.join((jamb_state, jamb_lga))
+    state_lga = context.waeup_tool.findLga(words,words_dict)
+    if state_lga:
+        msg = "found %s for %s " % (state_lga,student_record.id)
+        logger.info(msg)
+        d[student_record.id] = state_lga
+        if len(d) and not len(d)  % commit_after:
+            logger.info("found %d to correct state/lga combinations of %d so far" % (len(d),count))
+    else:
+        msg = "no '%s' for %s" % (words,student_record.id)
+logger.info("found %d correct lga values" % len(d))
+edited = 1
+for student_id,lga in d.items():
+    msg = "set clearance.lga to %s for %s" % (lga,student_id)
+    getattr(getattr(students_folder,student_id),'clearance').getContent().edit(mapping={'lga':lga})
+    logger.info(msg)
+    edited += 1
+    if edited and not edited  % commit_after:
+        context.waeup_tool.doCommit()
+        logger.info("Committing %d,  %d" % (commit_after,edited))
+logger.info('finished, %d checked, %d edited' % (count,
+                                               edited,))
+
Index: WAeUP_SRP/base/skins/waeup_utilities/ti_441_resolve_part1.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_utilities/ti_441_resolve_part1.py	(revision 3209)
+++ 	(revision )
@@ -1,98 +1,0 @@
-## Script (Python) "ti_441_resolve_part1"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# $Id: ti_441_resolve.py 2979 2008-01-05 15:01:33Z henrik $
-"""
-"""
-try:
-    from Products.zdb import set_trace
-except:
-    def set_trace():
-        pass
-
-mtool = context.portal_membership
-member = mtool.getAuthenticatedMember()
-if str(member) not in ('admin','joachim'):
-    return
-
-
-import logging
-import DateTime
-logger = logging.getLogger('Skins.ti_441_resolve_part1')
-from Products.AdvancedQuery import Eq, Between, Le,In
-aq_portal = context.portal_catalog_real.evalAdvancedQuery
-aq_students = context.students_catalog.evalAdvancedQuery
-students_folder = context.portal_url.getPortalObject().campus.students
-
-request = context.REQUEST
-session = request.SESSION
-response = request.RESPONSE
-setheader = request.RESPONSE.setHeader
-def rwrite(s):
-    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
-    response.write("%s<br>\n\r" % s)
-
-re_split = context.waeup_tool.re_split
-query = Eq('lga','')
-student_records = aq_students(query)
-total = len(student_records)
-logger.info("found %d records with empty clearance lga" % total)
-count = 0
-commit_after = 100
-logger.info('started to fix %d records' % total)
-mapping = context.waeup_tool.getStatesLgas()
-states = mapping['states']
-lgas = mapping['lgas']
-words_dict = mapping['word_dict']
-d = {}
-for student_record in student_records:
-    count += 1
-    jamb_state = getattr(getattr(students_folder,student_record.id),'application').getContent().jamb_state
-    jamb_lga = getattr(getattr(students_folder,student_record.id),'application').getContent().jamb_lga
-    words = ' '.join((jamb_state, jamb_lga))
-    # words = re_split('[^a-zA-Z0-9/]',words)
-    # lga_words = []
-    # for word in words:
-    #     if word:
-    #         lga_words += word.lower(),
-    # lga_words.sort()
-    # state_lga = ''
-    # while not state_lga:
-    #     for k,l in words_dict.items():
-    #         if lga_words == l:
-    #             state_lga = k
-    #             break
-    #     break
-    state_lga = context.waeup_tool.findLga(words,words_dict)
-    if state_lga:
-        msg = "found %s is %s for %s " % (state_lga,student_record.lga,student_record.id)
-        #rwrite(msg)
-        logger.info(msg)
-        d[student_record.id] = state_lga
-        if len(d) and not len(d)  % commit_after:
-            logger.info("found %d to correct state/lga combinations of %d so far" % (len(d),count))
-    else:
-        msg = "no '%s' for %s" % (words,student_record.id)
-        #logger.info(msg)
-        #rwrite(msg)
-    # if count > 150:
-    #     break
-logger.info("found %d correct lga values" % len(d))
-edited = 1
-for student_id,lga in d.items():
-    msg = "set clearance.lga to %s for %s" % (lga,student_id)
-    getattr(getattr(students_folder,student_id),'clearance').getContent().edit(mapping={'lga':lga})
-    logger.info(msg)
-    edited += 1
-    if edited and not edited  % commit_after:
-        context.waeup_tool.doCommit()
-        logger.info("Committing %d,  %d" % (commit_after,edited))
-logger.info('finished, %d checked, %d edited' % (count,
-                                               edited,))
-
