summaryrefslogtreecommitdiff
path: root/community/ktoblzcheck/ktoblzcheck-python3.patch
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/ktoblzcheck/ktoblzcheck-python3.patch
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/ktoblzcheck/ktoblzcheck-python3.patch')
-rw-r--r--community/ktoblzcheck/ktoblzcheck-python3.patch107
1 files changed, 107 insertions, 0 deletions
diff --git a/community/ktoblzcheck/ktoblzcheck-python3.patch b/community/ktoblzcheck/ktoblzcheck-python3.patch
new file mode 100644
index 000000000..c94e0a021
--- /dev/null
+++ b/community/ktoblzcheck/ktoblzcheck-python3.patch
@@ -0,0 +1,107 @@
+diff -ur ktoblzcheck-1.28/py-compile ktoblzcheck-1.28.my/py-compile
+--- ktoblzcheck-1.28/py-compile 2008-03-11 09:29:51.000000000 +0000
++++ ktoblzcheck-1.28.my/py-compile 2010-09-20 09:09:53.000000000 +0000
+@@ -107,34 +107,30 @@
+
+ files = '''$files'''
+
+-print 'Byte-compiling python modules...'
+-for file in string.split(files):
++print('Byte-compiling python modules...')
++for file in files.split():
+ $pathtrans
+ $filetrans
+- if not os.path.exists(filepath) or not (len(filepath) >= 3
+- and filepath[-3:] == '.py'):
+- continue
+- print file,
+- sys.stdout.flush()
++ if not os.path.exists(filepath) or not (len(filepath) >= 3 and filepath[-3:] == '.py'):
++ continue
++ print(file, sys.stdout.flush())
+ py_compile.compile(filepath, filepath + 'c', path)
+-print" || exit $?
++print()" || exit $?
+
+ # this will fail for python < 1.5, but that doesn't matter ...
+ $PYTHON -O -c "
+ import sys, os, string, py_compile
+
+ files = '''$files'''
+-print 'Byte-compiling python modules (optimized versions) ...'
+-for file in string.split(files):
++print('Byte-compiling python modules (optimized versions) ...')
++for file in files.split():
+ $pathtrans
+ $filetrans
+- if not os.path.exists(filepath) or not (len(filepath) >= 3
+- and filepath[-3:] == '.py'):
+- continue
+- print file,
+- sys.stdout.flush()
++ if not os.path.exists(filepath) or not (len(filepath) >= 3 and filepath[-3:] == '.py'):
++ continue
++ print(file,sys.stdout.flush())
+ py_compile.compile(filepath, filepath + 'o', path)
+-print" 2>/dev/null || :
++print()" 2>/dev/null || :
+
+ # Local Variables:
+ # mode: shell-script
+diff -ur ktoblzcheck-1.28/src/python/ktoblzcheck.py ktoblzcheck-1.28.my/src/python/ktoblzcheck.py
+--- ktoblzcheck-1.28/src/python/ktoblzcheck.py 2008-08-12 16:48:54.000000000 +0000
++++ ktoblzcheck-1.28.my/src/python/ktoblzcheck.py 2010-09-20 09:08:36.000000000 +0000
+@@ -197,35 +197,35 @@
+
+ def test():
+ a = AccountNumberCheck()
+- print 'Number of Banks:', a.bankCount
+- print 'find 20010020:', a.findBank('20010020')
+- print 'find 20010033:', a.findBank('20010033')
+- print 'check 20070024/9291394:', a.check('20070024','9291394')
+- print 'check 20070024/9291394:', a.check('20070024','9291394023')
+- print
++ print('Number of Banks:', a.bankCount)
++ print('find 20010020:', a.findBank('20010020'))
++ print('find 20010033:', a.findBank('20010033'))
++ print('check 20070024/9291394:', a.check('20070024','9291394'))
++ print('check 20070024/9291394:', a.check('20070024','9291394023'))
++ print()
+ ck = IbanCheck()
+ if not kto.IbanCheck_selftest(ck): # not publicly defined
+- print "Self-Test failed!"
++ print("Self-Test failed!")
+ raise SystemExit
+ s = " iban fr14 2004 1010 0505 0001 3m02 606"
+- print "test for iban :", s
++ print("test for iban :", s)
+ iban = Iban(s)
+- print "transmission form:", iban.transmissionForm()
++ print("transmission form:", iban.transmissionForm())
+ res = ck.check(iban)
+- print "check result :", res, "("+IbanCheck.resultText(res)+")"
+- print "printable form :", iban.printableForm()
+- print
+- print "expect bad checksum:"
++ print("check result :", res, "("+IbanCheck.resultText(res)+")")
++ print("printable form :", iban.printableForm())
++ print()
++ print("expect bad checksum:")
+ s = "FR1420041010050500013X02606"
+ res = ck.check(s)
+- print s + ":", res, "("+IbanCheck.resultText(res)+")"
+- print
++ print(s + ":", res, "("+IbanCheck.resultText(res)+")")
++ print()
+ s = "IBAN DE66 2007 0024 0929 1394 00"
+- print s
++ print(s)
+ s = Iban(s).transmissionForm()
+ start, end = ck.bic_position(s)
+- print "prefix, checksum, BIC, account:"
+- print ', '.join((s[:2], s[2:4], s[start:end], s[end:].lstrip('0')))
++ print("prefix, checksum, BIC, account:")
++ print(', '.join((s[:2], s[2:4], s[start:end], s[end:].lstrip('0'))))
+
+
+ if __name__ == '__main__':