Index: WAeUP_SRP/base/skins/waeup_epayment/upgradePayments.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_epayment/upgradePayments.py	(revision 2944)
+++ 	(revision )
@@ -1,71 +1,0 @@
-## Script (Python) "upgradePayments.py"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# $Id$
-"""
-"""
-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.upgradePayments')
-from Products.AdvancedQuery import Eq, Between, Le,In
-aq_portal = context.portal_catalog_real.evalAdvancedQuery
-aq_student = 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)
-
-count = 1
-d = {}
-l = []
-sum_total = 0.0
-log_after = 100
-logger.info("start")
-query = Eq('portal_type','Payment')
-payments = aq_portal(query,sortSpecs=('container_path',))
-total = len(payments)
-logger.info("found %d payments" % total)
-sid = "xxx"
-count = 0
-commit_after = 500
-commit_count = 0
-
-student_id = ''
-for payment_brain in payments:
-    count += 1
-    payment = payment_brain.getObject()
-    if payment_brain.getPath().split('/')[-3] != student_id:
-        student_id = payment_brain.getPath().split('/')[-3]
-        student_record = context.students_catalog.getRecordByKey(student_id)
-    payment['updatePayment'](student_record)
-    #logger.info('upgraded student %s payment %s' % (student_record.id,payment.getId()))
-    if not count % commit_after:
-        logger.info("committing %d total %d" % (commit_after,count))
-        commit_count += 1
-        context.waeup_tool.doCommit()
-        #if not commit_count % 2:
-        #    break
-logger.info("%d of %d upgraded" % (count,total))
Index: WAeUP_SRP/base/skins/waeup_utilities/upgradePayments.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_utilities/upgradePayments.py	(revision 2947)
+++ WAeUP_SRP/base/skins/waeup_utilities/upgradePayments.py	(revision 2947)
@@ -0,0 +1,71 @@
+## Script (Python) "upgradePayments.py"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: upgradePayments.py 2931 2007-12-13 06:32:18Z 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.upgradePayments')
+from Products.AdvancedQuery import Eq, Between, Le,In
+aq_portal = context.portal_catalog_real.evalAdvancedQuery
+aq_student = 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)
+
+count = 1
+d = {}
+l = []
+sum_total = 0.0
+log_after = 100
+logger.info("start")
+query = Eq('portal_type','Payment')
+payments = aq_portal(query,sortSpecs=('container_path',))
+total = len(payments)
+logger.info("found %d payments" % total)
+sid = "xxx"
+count = 0
+commit_after = 500
+commit_count = 0
+
+student_id = ''
+for payment_brain in payments:
+    count += 1
+    payment = payment_brain.getObject()
+    if payment_brain.getPath().split('/')[-3] != student_id:
+        student_id = payment_brain.getPath().split('/')[-3]
+        student_record = context.students_catalog.getRecordByKey(student_id)
+    payment['updatePayment'](student_record)
+    #logger.info('upgraded student %s payment %s' % (student_record.id,payment.getId()))
+    if not count % commit_after:
+        logger.info("committing %d total %d" % (commit_after,count))
+        commit_count += 1
+        context.waeup_tool.doCommit()
+        #if not commit_count % 2:
+        #    break
+logger.info("%d of %d upgraded" % (count,total))
