=== added file 'doc/index.html'
--- doc/index.html 1970-01-01 00:00:00 +0000
+++ doc/index.html 2012-07-25 06:33:20 +0000
@@ -0,0 +1,10 @@
+
+
+One second ...
+
+
+
+
+
+
+
\ No newline at end of file
=== modified file 'examples/echoClient.py'
--- examples/echoClient.py 2009-08-27 15:34:49 +0000
+++ examples/echoClient.py 2012-07-25 06:33:20 +0000
@@ -26,7 +26,7 @@
# Configure the client
-serverIP = "192.168.0.100"
+serverIP = "192.168.0.103"
serverPort = 8583
numberEcho = 5
timeBetweenEcho = 5 # in seconds
@@ -50,7 +50,7 @@
continue
break
if s is None:
- print 'Could not connect :('
+ print ('Could not connect :(')
sys.exit(1)
@@ -67,19 +67,19 @@
try:
message = iso.getNetworkISO()
s.send(message)
- print 'Sending ... %s' % message
+ print ('Sending ... %s' % message)
ans = s.recv(2048)
- print "\nInput ASCII |%s|" % ans
+ print ("\nInput ASCII |%s|" % ans)
isoAns = ISO8583()
isoAns.setNetworkISO(ans)
v1 = isoAns.getBitsAndValues()
for v in v1:
- print 'Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value'])
+ print ('Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value']))
if isoAns.getMTI() == '0810':
- print "\tThat's great !!! The server understand my message !!!"
+ print ("\tThat's great !!! The server understand my message !!!")
else:
- print "The server dosen't understand my message!"
+ print ("The server dosen't understand my message!")
except InvalidIso8583, ii:
print ii
@@ -92,19 +92,19 @@
try:
message = iso.getNetworkISO(False)
s.send(message)
- print 'Sending ... %s' % message
+ print ('Sending ... %s' % message)
ans = s.recv(2048)
- print "\nInput ASCII |%s|" % ans
+ print ("\nInput ASCII |%s|" % ans)
isoAns = ISO8583()
isoAns.setNetworkISO(ans,False)
v1 = isoAns.getBitsAndValues()
for v in v1:
- print 'Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value'])
+ print ('Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value']))
if isoAns.getMTI() == '0810':
- print "\tThat's great !!! The server understand my message !!!"
+ print ("\tThat's great !!! The server understand my message !!!")
else:
- print "The server dosen't understand my message!"
+ print ("The server dosen't understand my message!")
except InvalidIso8583, ii:
print ii
@@ -114,6 +114,6 @@
-print 'Closing...'
+print ('Closing...')
s.close()
\ No newline at end of file
=== modified file 'examples/echoServer.py'
--- examples/echoServer.py 2009-08-27 15:34:49 +0000
+++ examples/echoServer.py 2012-07-25 06:33:20 +0000
@@ -23,7 +23,7 @@
from socket import *
# Configure the server
-serverIP = "192.168.0.100"
+serverIP = "192.168.0.103"
serverPort = 8583
maxConn = 5
bigEndian = True
@@ -46,7 +46,7 @@
# receive message
isoStr = connection.recv(2048)
if isoStr:
- print "\nInput ASCII |%s|" % isoStr
+ print ("\nInput ASCII |%s|" % isoStr)
pack = ISO8583()
#parse the iso
try:
@@ -57,12 +57,12 @@
v1 = pack.getBitsAndValues()
for v in v1:
- print 'Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value'])
+ print ('Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value']))
if pack.getMTI() == '0800':
- print "\tThat's great !!! The client send a correct message !!!"
+ print ("\tThat's great !!! The client send a correct message !!!")
else:
- print "The client dosen't send the correct message!"
+ print ("The client dosen't send the correct message!")
break
@@ -70,7 +70,7 @@
print ii
break
except:
- print 'Something happened!!!!'
+ print ('Something happened!!!!')
break
#send answer
@@ -81,11 +81,11 @@
else:
ans = pack.getNetworkISO(False)
- print 'Sending answer %s' % ans
+ print ('Sending answer %s' % ans)
connection.send(ans)
else:
break
# close socket
connection.close()
- print "Closed..."
\ No newline at end of file
+ print ("Closed...")
\ No newline at end of file
=== modified file 'examples/example1.py'
--- examples/example1.py 2009-08-27 15:34:49 +0000
+++ examples/example1.py 2012-07-25 06:33:20 +0000
@@ -29,13 +29,13 @@
p = ISO8583()
#some string describing the transation type
transation = "200"
-print 'Setting transation type to %s' % transation
+print ('Setting transation type to %s' % transation)
p.setTransationType(transation)
# Is the same that:
#p.setMTI(transation)
#Some tests and
-print 'Setting bits'
+print ('Setting bits')
p.setBit(3,"100000")
p.setBit(4,1200)
@@ -53,47 +53,47 @@
try:
p.setBit(126,"00000000000000105")
except ValueToLarge:
- print '\t\tSomething happening!!!! The Exception! So, bit 126 is not set!!!!'
+ print ('\t\tSomething happening!!!! The Exception! So, bit 126 is not set!!!!')
#if want more information ...
#traceback.print_exc()
#show hex bitmap
-print 'Bitmap in HEX'
+print ('Bitmap in HEX')
p.showBitmap()
#Show bits
-print 'Bits with values'
+print ('Bits with values')
p.showIsoBits()
# Show raw ASCII ISO
-print 'The package is -> '
+print ('The package is -> ')
p.showRawIso()
# Getting bits...
-print '\n\n\n------------------------------------------\n'
+print ('\n\n\n------------------------------------------\n')
-print 'Getting bits'
+print ('Getting bits')
try:
- print 'Bit 7 is there? %s' % p.getBit(7)
- print 'Bit 32 is there? %s' % p.getBit(32)
+ print ('Bit 7 is there? %s' % p.getBit(7))
+ print ('Bit 32 is there? %s' % p.getBit(32))
except:
- print 'Something is bad...'
+ print ('Something is bad...')
# Testing exceptions...
try:
- print 'Bit 45 is there? %s' % p.getBit(45)
+ print ('Bit 45 is there? %s' % p.getBit(45))
except:
- print "No, this bit is not there :)"
+ print ("No, this bit is not there :)")
try:
- print 'Bit 27 is there? %s' % p.getBit(27)
+ print ('Bit 27 is there? %s' % p.getBit(27))
except BitNotSet, bns:
print bns
#More exceptions...
-print '\n\n\n------------------------------------------\n'
-print 'Exeptions....'
+print ('\n\n\n------------------------------------------\n')
+print ('Exceptions....')
iso = ISO8583()
try:
@@ -106,9 +106,9 @@
iso.setBit(49,9861) # this bit is wrong ...
iso.setBit(99,99)
except ValueToLarge, e:
- print 'Value too large :( %s' % e
+ print ('Value too large :( %s' % e)
except InvalidMTI, i:
- print 'This MTI is wrong :( %s' % i
+ print ('This MTI is wrong :( %s' % i)
=== modified file 'examples/example2.py'
--- examples/example2.py 2009-08-27 15:34:49 +0000
+++ examples/example2.py 2012-07-25 06:33:20 +0000
@@ -35,8 +35,8 @@
p2.setBit(17,17)
p2.setBit(99,99)
-print 'The MTI is = %s' %p2.getMTI()
-print 'The Bitmap is = %s' %p2.getBitmap()
+print ('The MTI is = %s' %p2.getMTI())
+print ('The Bitmap is = %s' %p2.getBitmap())
#Showing bits...
p2.showIsoBits();
@@ -44,8 +44,8 @@
#Save the ASCII ISO value without size
iso = p2.getRawIso()
-print '\n\n\n------------------------------------------\n'
-print 'This is the ISO <%s> that will be interpreted' % iso
+print ('\n\n\n------------------------------------------\n')
+print ('This is the ISO <%s> that will be interpreted' % iso)
# New ISO
i = ISO8583()
@@ -53,21 +53,21 @@
i.setIsoContent(iso)
# Showing that everything is ok
-print 'The MTI is = %s' %i.getMTI()
-print 'The Bitmap is = %s' %i.getBitmap()
-print 'Show bits inside the package'
+print ('The MTI is = %s' %i.getMTI())
+print ('The Bitmap is = %s' %i.getBitmap())
+print ('Show bits inside the package')
i.showIsoBits()
# Using == to compare ISOS's
-print 'Compare ISOs ...'
+print ('Compare ISOs ...')
if i == p2:
- print 'They are equivalent!'
+ print ('They are equivalent!')
else:
- print 'The are differente'
+ print ('The are differente')
# More example...
-print '\n\n\n------------------------------------------\n'
+print ('\n\n\n------------------------------------------\n')
i3=ISO8583()
i3.setMTI('0800')
@@ -79,6 +79,6 @@
i3.showIsoBits()
-print 'This is the pack %s' %i3.getRawIso()
+print ('This is the pack %s' %i3.getRawIso())
=== modified file 'examples/example3.py'
--- examples/example3.py 2009-08-27 15:34:49 +0000
+++ examples/example3.py 2012-07-25 06:33:20 +0000
@@ -36,41 +36,41 @@
p2.setBit(17,17)
p2.setBit(49,986)
p2.setBit(99,99)
-print 'MTI = %s' %p2.getMTI()
-print 'Bitmap = %s' %p2.getBitmap()
+print ('MTI = %s' %p2.getMTI())
+print ('Bitmap = %s' %p2.getBitmap())
p2.showIsoBits();
iso = p2.getRawIso()
#Show debug information of the parsing function
-print '\n\n\n------------------------------------------\n'
-print 'Parsing ... <%s> ' % iso
+print ('\n\n\n------------------------------------------\n')
+print ('Parsing ... <%s> ' % iso)
i = ISO8583()
i.setIsoContent(iso)
#Show information ... to compare
-print 'MTI = %s' %i.getMTI()
-print 'Bitmap = %s' %i.getBitmap()
-print 'Here we have bits'
+print ('MTI = %s' %i.getMTI())
+print ('Bitmap = %s' %i.getBitmap())
+print ('Here we have bits')
i.showIsoBits()
-print 'This is the bits and values (1)'
+print ('This is the bits and values (1)')
v1 = p2.getBitsAndValues()
-print '\n%s\n' %v1
+print ('\n%s\n' %v1)
-print 'This is the bits and values (2)'
+print ('This is the bits and values (2)')
v2 = i.getBitsAndValues()
-print '\n%s\n' %v2
+print ('\n%s\n' %v2)
-print 'One way of printing the information ...!'
+print ('One way of printing the information ...!')
for v in v1:
- print 'Bit %s of type %s has value = %s' % (v['bit'],v['type'],v['value'])
-
-
-print 'Another way...'
+ print ('Bit %s of type %s has value = %s' % (v['bit'],v['type'],v['value']))
+
+
+print ('Another way...')
for v in range(0,len(v2)):
- print 'Bit %s of type %s has value = %s' % (v2[v]['bit'],v2[v]['type'],v2[v]['value'])
+ print ('Bit %s of type %s has value = %s' % (v2[v]['bit'],v2[v]['type'],v2[v]['value']))
=== modified file 'examples/example4.py'
--- examples/example4.py 2009-08-27 15:34:49 +0000
+++ examples/example4.py 2012-07-25 06:33:20 +0000
@@ -43,32 +43,33 @@
'''
#i2 = ISO8583(debug=True)
i2 = ISO8583()
-# in this case, we need to redefine a bit because default bit 42 is LL and in this especification is "N"
-# the rest remain, so we use get :)
-i2.redefineBit(42, '42', i2.getLargeBitName(42), 'N', i2.getBitLimit(42), i2.getBitValueType(42) )
-
iso2 = '0210B238000102C080040000000000000002100000000000001700010814465469421614465701081100301000000N399915444303500019991544986020 Value not allowed!!009000095492'
-print '\n\n\n------------------------------------------\n'
-print 'This is the ISO <%s> parse it!' % iso2
+print ('\n\n\n------------------------------------------\n')
+print ('This is the ISO <%s> parse it!' % iso2)
i2.setIsoContent(iso2)
-print 'Bitmap = %s' %i2.getBitmap()
-print 'MTI = %s' %i2.getMTI()
+print ('Bitmap = %s' %i2.getBitmap())
+print ('MTI = %s' %i2.getMTI())
-print 'Bits'
+print ('Bits')
v3 = i2.getBitsAndValues()
for v in v3:
- print '(1) Bit %s of type %s and value = %s' % (v['bit'],v['type'],v['value'])
+ print ('(1) Bit %s of type %s and value = %s' % (v['bit'],v['type'],v['value']))
+# in this case, we need to redefine a bit because default bit 42 is A and in this especification is "N"
+# the rest remain, so we use get's to copy original values :)
+i2.redefineBit(42, '42', i2.getLargeBitName(42), 'N', i2.getBitLimit(42), i2.getBitValueType(42) )
+print ('\nBit 42 redefined...\n')
+
i3 = ISO8583(iso=iso2)
-print 'Bitmap = %s' %i3.getBitmap()
-print 'MTI = %s' %i3.getMTI()
+print ('Bitmap = %s' %i3.getBitmap())
+print ('MTI = %s' %i3.getMTI())
-print 'Bits inside'
+print ('Bits inside')
v4 = i3.getBitsAndValues()
for v in v4:
- print '(2) Bit %s of type %s and value = %s' % (v['bit'],v['type'],v['value'])
+ print ('(2) Bit %s of type %s and value = %s' % (v['bit'],v['type'],v['value']))
=== modified file 'setup.py'
--- setup.py 2009-08-27 15:34:49 +0000
+++ setup.py 2012-07-25 06:33:20 +0000
@@ -1,8 +1,9 @@
#!/usr/bin/env python
from distutils.core import setup
+
setup(name='ISO8583 Module',
- version='1.1',
+ version='1.2',
description='ISO8583 LIBRARY',
author='Igor V. Custodio',
author_email='igorvc@vulcanno.com.br',
|