Merge lp:~logan/ubuntu/quantal/python-iso8583/new-upstream into lp:ubuntu/quantal/python-iso8583

Proposed by Logan Rosen
Status: Merged
Merge reported by: Dimitri John Ledkov
Merged at revision: not available
Proposed branch: lp:~logan/ubuntu/quantal/python-iso8583/new-upstream
Merge into: lp:ubuntu/quantal/python-iso8583
Diff against target: 1163 lines (+296/-169)
15 files modified
ISO8583/ISO8583.py (+68/-71)
PKG-INFO (+1/-1)
TODO (+74/-0)
debian/changelog (+9/-0)
debian/control (+4/-3)
debian/rules (+3/-1)
doc/ISO8583.ISO8583.html (+42/-10)
doc/index.html (+10/-0)
examples/echoClient.py (+13/-13)
examples/echoServer.py (+8/-8)
examples/example1.py (+18/-18)
examples/example2.py (+12/-12)
examples/example3.py (+17/-17)
examples/example4.py (+15/-14)
setup.py (+2/-1)
To merge this branch: bzr merge lp:~logan/ubuntu/quantal/python-iso8583/new-upstream
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Approve
Ubuntu branches Pending
Review via email: mp+116588@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Another fine contribution to Ubuntu, thanks again. All of my previous comments on your packages do apply to this one too. It's ideal to get updates into Debian first so that it is easier to keep Ubuntu in sync. Please do file bugs in Debian and Ubuntu so that we can get this package resync'd again later.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ISO8583/ISO8583.py'
2--- ISO8583/ISO8583.py 2009-08-27 15:34:49 +0000
3+++ ISO8583/ISO8583.py 2012-07-25 06:33:20 +0000
4@@ -16,8 +16,19 @@
5 along with this program. If not, see <http://www.gnu.org/licenses/>.
6
7 """
8-"""
9- ISO8583 Class.
10+
11+__author__ = 'Igor Vitorio Custodio <igorvc@vulcanno.com.br>'
12+__version__= '1.2'
13+__licence__ = 'GPL V3'
14+
15+
16+
17+from ISOErrors import *
18+import struct
19+
20+
21+class ISO8583:
22+ """Main Class to work with ISO8583 packages.
23 Used to create, change, send, receive, parse or work with ISO8593 Package version 1993.
24 It's 100% Python :)
25 Enjoy it!
26@@ -40,32 +51,18 @@
27 iso.setBit(49,986)
28 iso.setBit(99,99)
29 except ValueToLarge, e:
30- print 'Value too large :( %s' % e
31+ print ('Value too large :( %s' % e)
32 except InvalidMTI, i:
33- print 'This MTI is wrong :( %s' % i
34+ print ('This MTI is wrong :( %s' % i)
35
36- print 'The Message Type Indication is = %s' %iso.getMTI()
37+ print ('The Message Type Indication is = %s' %iso.getMTI())
38
39- print 'The Bitmap is = %s' %iso.getBitmap()
40+ print ('The Bitmap is = %s' %iso.getBitmap())
41 iso.showIsoBits();
42- print 'This is the ISO8583 complete package %s' % iso.getRawIso()
43- print 'This is the ISO8583 complete package to sent over the TCPIP network %s' % iso.getNetworkISO()
44+ print ('This is the ISO8583 complete package %s' % iso.getRawIso())
45+ print ('This is the ISO8583 complete package to sent over the TCPIP network %s' % iso.getNetworkISO())
46
47 """
48-
49-__author__ = 'Igor Vitorio Custodio <igorvc@vulcanno.com.br>'
50-__version__= '0.2'
51-__licence__ = 'GPL V3'
52-
53-
54-
55-from ISOErrors import *
56-import struct
57-
58-
59-class ISO8583:
60- """Main Class to work with ISO8583 packages.
61- """
62 #Attributes
63 # Bitsto be set 00000000 -> _BIT_POSITION_1 ... _BIT_POSITION_8
64 _BIT_POSITION_1 = 128 # 10 00 00 00
65@@ -130,7 +127,7 @@
66 _BITS_VALUE_TYPE[37] = ['37','Retrieval reference number','N',12,'an']
67 _BITS_VALUE_TYPE[38] = ['38','Approval code','N',6,'an']
68 _BITS_VALUE_TYPE[39] = ['39','Action code','A',2,'an']
69- _BITS_VALUE_TYPE[40] = ['40','Service code','N3',3,'an']
70+ _BITS_VALUE_TYPE[40] = ['40','Service code','N',3,'an']
71 _BITS_VALUE_TYPE[41] = ['41','Card acceptor terminal identification','N',8,'ans']
72 _BITS_VALUE_TYPE[42] = ['42','Card acceptor identification code','A',15,'ans']
73 _BITS_VALUE_TYPE[43] = ['43','Card acceptor name/location','A',40,'asn']
74@@ -191,7 +188,7 @@
75 _BITS_VALUE_TYPE[98] = ['98','Payee','ANS',25,'ans']
76 _BITS_VALUE_TYPE[99] = ['99','Settlement institution identification code','LL',11,'n']
77 _BITS_VALUE_TYPE[100] = ['100','Receiving institution identification code','LL',11,'n']
78- _BITS_VALUE_TYPE[101] = ['101','File name','ASN',17,'ans']
79+ _BITS_VALUE_TYPE[101] = ['101','File name','ANS',17,'ans']
80 _BITS_VALUE_TYPE[102] = ['102','Account identification 1','LL',28,'ans']
81 _BITS_VALUE_TYPE[103] = ['103','Account identification 2','LL',28,'ans']
82 _BITS_VALUE_TYPE[104] = ['104','Transaction description','LLL',100,'ans']
83@@ -332,7 +329,7 @@
84 """
85
86 if self.DEBUG == True:
87- print 'Init bitmap'
88+ print ('Init bitmap')
89
90 if len(self.BITMAP) == 16:
91 for cont in range(0,16):
92@@ -349,7 +346,7 @@
93 It's a internal method, so don't call!
94 """
95 if self.DEBUG == True:
96- print 'Init bitmap_values'
97+ print ('Init bitmap_values')
98
99 if len(self.BITMAP_VALUES) == 128:
100 for cont in range(0,128):
101@@ -370,7 +367,7 @@
102 @raise: BitInexistent Exception, ValueToLarge Exception
103 """
104 if self.DEBUG == True:
105- print 'Setting bit inside bitmap bit[%s] = %s' % (bit, value)
106+ print ('Setting bit inside bitmap bit[%s] = %s') % (bit, value)
107
108 if bit < 1 or bit > 128:
109 raise BitInexistent("Bit number %s dosen't exist!" % bit)
110@@ -441,7 +438,7 @@
111 if (self.BITMAP[0] & self._BIT_POSITION_1) != self._BIT_POSITION_1:
112 # Only has the first bitmap
113 if self.DEBUG == True:
114- print '%d Bitmap = %d(Decimal) = %s (hexa) ' %(c, self.BITMAP[c], hex(self.BITMAP[c]))
115+ print ('%d Bitmap = %d(Decimal) = %s (hexa) ' %(c, self.BITMAP[c], hex(self.BITMAP[c])))
116
117 tm = hex(self.BITMAP[c])[2:]
118 if len(tm) != 2:
119@@ -451,7 +448,7 @@
120 break
121 else: # second bitmap
122 if self.DEBUG == True:
123- print '%d Bitmap = %d(Decimal) = %s (hexa) ' %(c, self.BITMAP[c], hex(self.BITMAP[c]))
124+ print ('%d Bitmap = %d(Decimal) = %s (hexa) ' %(c, self.BITMAP[c], hex(self.BITMAP[c])))
125
126 tm = hex(self.BITMAP[c])[2:]
127 if len(tm) != 2:
128@@ -476,7 +473,7 @@
129 for x in range(0,32,2):
130 if (int(bitmap[0:2],16) & self._BIT_POSITION_1) != self._BIT_POSITION_1: # Only 1 bitmap
131 if self.DEBUG == True:
132- print 'Token[%d] %s converted to int is = %s' %(x, bitmap[x:x+2], int(bitmap[x:x+2],16))
133+ print ('Token[%d] %s converted to int is = %s' %(x, bitmap[x:x+2], int(bitmap[x:x+2],16)))
134
135 self.BITMAP_HEX += bitmap[x:x+2]
136 self.BITMAP[cont] = int(bitmap[x:x+2],16)
137@@ -484,7 +481,7 @@
138 break
139 else: # Second bitmap
140 if self.DEBUG == True:
141- print 'Token[%d] %s converted to int is = %s' %(x, bitmap[x:x+2], int(bitmap[x:x+2],16))
142+ print ('Token[%d] %s converted to int is = %s' %(x, bitmap[x:x+2], int(bitmap[x:x+2],16)))
143
144 self.BITMAP_HEX += bitmap[x:x+2]
145 self.BITMAP[cont] = int(bitmap[x:x+2],16)
146@@ -499,7 +496,7 @@
147 @param: bitmap -> bitmap str to be analized and translated to "bits"
148 """
149 bits = self.__inicializeBitsFromBitmapStr(bitmap)
150- print 'Bits inside %s = %s' % (bitmap,bits)
151+ print ('Bits inside %s = %s' % (bitmap,bits))
152 ################################################################################################
153
154 ################################################################################################
155@@ -513,23 +510,23 @@
156 for c in range(0,16):
157 for d in range(1,9):
158 if self.DEBUG == True:
159- print 'Value (%d)-> %s & %s = %s' % (d,self.BITMAP[c] , self._TMP[d], (self.BITMAP[c] & self._TMP[d]) )
160+ print ('Value (%d)-> %s & %s = %s' % (d,self.BITMAP[c] , self._TMP[d], (self.BITMAP[c] & self._TMP[d]) ))
161 if (self.BITMAP[c] & self._TMP[d]) == self._TMP[d]:
162 if d == 1: # e o 8 bit
163 if self.DEBUG == True:
164- print 'Bit %s is present !!!' % ((c +1)* 8)
165+ print ('Bit %s is present !!!' % ((c +1)* 8))
166 bits.append((c +1)* 8)
167 self.BITMAP_VALUES[(c +1)* 8] = 'X'
168 else:
169 if (c == 0) & (d == 2): # Continuation bit
170 if self.DEBUG == True:
171- print 'Bit 1 is present !!!'
172+ print ('Bit 1 is present !!!')
173
174 bits.append(1)
175
176 else:
177 if self.DEBUG == True:
178- print 'Bit %s is present !!!' % (c * 8 + d - 1)
179+ print ('Bit %s is present !!!' % (c * 8 + d - 1))
180
181 bits.append(c * 8 + d - 1)
182 self.BITMAP_VALUES[c * 8 + d - 1] = 'X'
183@@ -549,23 +546,23 @@
184 for c in range(0,16):
185 for d in range(1,9):
186 if self.DEBUG == True:
187- print 'Value (%d)-> %s & %s = %s' % (d,self.BITMAP[c] , self._TMP[d], (self.BITMAP[c] & self._TMP[d]) )
188+ print ('Value (%d)-> %s & %s = %s' % (d,self.BITMAP[c] , self._TMP[d], (self.BITMAP[c] & self._TMP[d]) ))
189 if (self.BITMAP[c] & self._TMP[d]) == self._TMP[d]:
190 if d == 1: # e o 8 bit
191 if self.DEBUG == True:
192- print 'Bit %s is present !!!' % ((c +1)* 8)
193+ print ('Bit %s is present !!!' % ((c +1)* 8))
194
195 bits.append((c +1)* 8)
196 else:
197 if (c == 0) & (d == 2): # Continuation bit
198 if self.DEBUG == True:
199- print 'Bit 1 is present !!!'
200+ print ('Bit 1 is present !!!')
201
202 bits.append(1)
203
204 else:
205 if self.DEBUG == True:
206- print 'Bit %s is present !!!' % (c * 8 + d - 1)
207+ print ('Bit %s is present !!!' % (c * 8 + d - 1))
208
209 bits.append(c * 8 + d - 1)
210
211@@ -735,7 +732,7 @@
212 """
213
214 for cont in range(0,128):
215- if self.BITMAP_VALUES[cont] <> self._BIT_DEFAULT_VALUE:
216+ if self.BITMAP_VALUES[cont] != self._BIT_DEFAULT_VALUE:
217 print("Bit[%s] of type %s has limit %s = %s"%(cont,self.getBitType(cont),self.getBitLimit(cont), self.BITMAP_VALUES[cont]) )
218
219
220@@ -777,7 +774,7 @@
221 iso.setBit(17,17)
222 iso.setBit(99,99)
223 str = iso.getRawIso()
224- print 'This is the ASCII package %s' % str
225+ print ('This is the ASCII package %s' % str)
226 output (print) -> This is the ASCII package 0800d010800000000000000000002000000001200000000000400001200170299
227
228 @return: str with complete ASCII ISO8583
229@@ -795,7 +792,7 @@
230 resp += self.BITMAP_HEX
231
232 for cont in range(0,128):
233- if self.BITMAP_VALUES[cont] <> self._BIT_DEFAULT_VALUE:
234+ if self.BITMAP_VALUES[cont] != self._BIT_DEFAULT_VALUE:
235 resp = "%s%s"%(resp, self.BITMAP_VALUES[cont])
236
237 return resp
238@@ -822,7 +819,7 @@
239 """
240
241 if self.DEBUG == True:
242- print 'Trying to redefine the bit with (self,%s,%s,%s,%s,%s,%s)' % (bit, smallStr, largeStr, bitType, size, valueType)
243+ print ('Trying to redefine the bit with (self,%s,%s,%s,%s,%s,%s)' % (bit, smallStr, largeStr, bitType, size, valueType))
244
245 #validating bit position
246 if bit == 1 or bit == 64 or bit < 0 or bit > 128:
247@@ -831,10 +828,10 @@
248 #need to validate if the type and size is compatible! example slimit = 100 and type = LL
249
250 if bitType == "B" or bitType == "N" or bitType == "AN" or bitType == "ANS" or bitType == "LL" or bitType == "LLL":
251- if valueType == "a" or valueType == "n" or valueType == "ansb" or valueType == "ans" or valueType == "b" :
252+ if valueType == "a" or valueType == "n" or valueType == "ansb" or valueType == "ans" or valueType == "b" or valueType == "an" :
253 self._BITS_VALUE_TYPE[bit] = [smallStr, largeStr, bitType, size, valueType]
254 if self.DEBUG == True:
255- print 'Bit %d redefined!' % bit
256+ print ('Bit %d redefined!' % bit)
257
258 else:
259 raise InvalidValueType("Error bit %d cannot be changed because %s is not a valid valueType (a, an, n ansb, b)!" % (bit,valueType))
260@@ -855,7 +852,7 @@
261 self.MESSAGE_TYPE_INDICATION = iso[0:4]
262
263 if self.DEBUG == True:
264- print 'MTI found was %s' % self.MESSAGE_TYPE_INDICATION
265+ print ('MTI found was %s' % self.MESSAGE_TYPE_INDICATION)
266
267
268 ################################################################################################
269@@ -907,40 +904,40 @@
270 """
271
272 if self.DEBUG == True:
273- print 'This is the input string <%s>' % strWithoutMtiBitmap
274+ print ('This is the input string <%s>' % strWithoutMtiBitmap)
275
276 offset = 0;
277 # jump bit 1 because it was alread defined in the "__inicializeBitsFromBitmapStr"
278 for cont in range(2,128):
279- if self.BITMAP_VALUES[cont] <> self._BIT_DEFAULT_VALUE:
280+ if self.BITMAP_VALUES[cont] != self._BIT_DEFAULT_VALUE:
281 if self.DEBUG == True:
282- print 'String = %s offset = %s bit = %s' % (strWithoutMtiBitmap[offset:],offset,cont)
283+ print ('String = %s offset = %s bit = %s' % (strWithoutMtiBitmap[offset:],offset,cont))
284
285 if self.getBitType(cont) == 'LL':
286 valueSize = int(strWithoutMtiBitmap[offset:offset +2])
287 if self.DEBUG == True:
288- print 'Size of the message in LL = %s' %valueSize
289+ print ('Size of the message in LL = %s' %valueSize)
290
291 if valueSize > self.getBitLimit(cont):
292 raise ValueToLarge("This bit is larger than the especification!")
293 self.BITMAP_VALUES[cont] = strWithoutMtiBitmap[offset:offset+2] + strWithoutMtiBitmap[offset+2:offset+2+valueSize]
294
295 if self.DEBUG == True:
296- print '\tSetting bit %s value %s' % (cont,self.BITMAP_VALUES[cont])
297+ print ('\tSetting bit %s value %s' % (cont,self.BITMAP_VALUES[cont]))
298
299 offset += valueSize + 2
300
301 if self.getBitType(cont) == 'LLL':
302 valueSize = int(strWithoutMtiBitmap[offset:offset +3])
303 if self.DEBUG == True:
304- print 'Size of the message in LLL = %s' %valueSize
305+ print ('Size of the message in LLL = %s' %valueSize)
306
307 if valueSize > self.getBitLimit(cont):
308 raise ValueToLarge("This bit is larger than the especification!")
309 self.BITMAP_VALUES[cont] = strWithoutMtiBitmap[offset:offset+3] + strWithoutMtiBitmap[offset+3:offset+3+valueSize]
310
311 if self.DEBUG == True:
312- print '\tSetting bit %s value %s' % (cont,self.BITMAP_VALUES[cont])
313+ print ('\tSetting bit %s value %s' % (cont,self.BITMAP_VALUES[cont]))
314
315 offset += valueSize + 3
316
317@@ -951,11 +948,11 @@
318 # self.BITMAP_VALUES[cont] = '(' + strWithoutMtiBitmap[offset:offset+4] + ')' + strWithoutMtiBitmap[offset+4:offset+4+valueSize]
319 # offset += valueSize + 4
320
321- if self.getBitType(cont) == 'N' or self.getBitType(cont) == 'A' or self.getBitType(cont) == 'ANS':
322+ if self.getBitType(cont) == 'N' or self.getBitType(cont) == 'A' or self.getBitType(cont) == 'ANS' or self.getBitType(cont) == 'B' or self.getBitType(cont) == 'AN' :
323 self.BITMAP_VALUES[cont] = strWithoutMtiBitmap[offset:self.getBitLimit(cont)+offset]
324
325 if self.DEBUG == True:
326- print '\tSetting bit %s value %s' % (cont,self.BITMAP_VALUES[cont])
327+ print ('\tSetting bit %s value %s' % (cont,self.BITMAP_VALUES[cont]))
328
329 offset += self.getBitLimit(cont)
330
331@@ -979,7 +976,7 @@
332 print 'This ISO has bits:'
333 v3 = i2.getBitsAndValues()
334 for v in v3:
335- print 'Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value'])
336+ print ('Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value']))
337
338 @param: str -> complete ISO8583 string
339 @raise: InvalidIso8583 Exception
340@@ -987,18 +984,18 @@
341 if len(iso) < 20:
342 raise InvalidIso8583('This is not a valid iso!!')
343 if self.DEBUG == True:
344- print 'ASCII to process <%s>' % iso
345+ print ('ASCII to process <%s>' % iso)
346
347 self.__setMTIFromStr(iso)
348 isoT = iso[4:]
349 self.__getBitmapFromStr(isoT)
350 self.__inicializeBitsFromBitmapStr(self.BITMAP_HEX)
351 if self.DEBUG == True:
352- print 'This is the array of bits (before) %s ' % self.BITMAP_VALUES
353+ print ('This is the array of bits (before) %s ' % self.BITMAP_VALUES)
354
355 self.__getBitFromStr(iso[4+len(self.BITMAP_HEX):])
356 if self.DEBUG == True:
357- print 'This is the array of bits (after) %s ' % self.BITMAP_VALUES
358+ print ('This is the array of bits (after) %s ' % self.BITMAP_VALUES)
359
360
361 ################################################################################################
362@@ -1024,9 +1021,9 @@
363
364 print 'Is equivalent?'
365 if p1 == p1:
366- print 'Yes :)'
367+ print ('Yes :)')
368 else:
369- print 'Noooooooooo :('
370+ print ('Noooooooooo :(')
371
372 @param: obj2 -> object that will be compared
373 @return: <0 if is not equal, 0 if is equal
374@@ -1059,13 +1056,13 @@
375
376 v1 = p1.getBitsAndValues()
377 for v in v1:
378- print 'Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value'])
379+ print ('Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value']))
380
381 @return: array of values.
382 """
383 ret = []
384 for cont in range(2,128):
385- if self.BITMAP_VALUES[cont] <> self._BIT_DEFAULT_VALUE:
386+ if self.BITMAP_VALUES[cont] != self._BIT_DEFAULT_VALUE:
387 _TMP = {}
388 _TMP['bit'] = "%d" % cont
389 _TMP['type'] = self.getBitType(cont)
390@@ -1091,7 +1088,7 @@
391 arr = self.__getBitsFromBitmap()
392
393 if self.DEBUG == True:
394- print 'This is the array of bits inside the bitmap %s' % arr
395+ print ('This is the array of bits inside the bitmap %s' % arr)
396
397 for v in arr:
398 if v == bit:
399@@ -1124,7 +1121,7 @@
400 netIso += ascii
401 # Example: big-endian
402 # To little-endian, replace 'iso.getNetworkISO()' with 'iso.getNetworkISO(False)'
403- print 'This <%s> the same that <%s>' % (iso.getNetworkISO(),netIso)
404+ print ('This <%s> the same that <%s>' % (iso.getNetworkISO(),netIso))
405
406 @param: bigEndian (True|False) -> if you want that the size be represented in this way.
407 @return: size + ASCII ISO8583 package ready to go to the network!
408@@ -1137,11 +1134,11 @@
409 if bigEndian:
410 netIso = struct.pack('!h',len(asciiIso))
411 if self.DEBUG == True:
412- print 'Pack Big-endian'
413+ print ('Pack Big-endian')
414 else:
415 netIso = struct.pack('<h',len(asciiIso))
416 if self.DEBUG == True:
417- print 'Pack Little-endian'
418+ print ('Pack Little-endian')
419
420 netIso += asciiIso
421
422@@ -1174,7 +1171,7 @@
423 #newIso.setIsoContent(netIso[2:size])
424 arr = newIso.getBitsAndValues()
425 for v in arr:
426- print 'Bit %s Type %s Value = %s' % (v['bit'],v['type'],v['value'])
427+ print ('Bit %s Type %s Value = %s' % (v['bit'],v['type'],v['value']))
428
429 @param: iso -> str that represents size + ASCII ISO8583 package
430 @param: bigEndian (True|False) -> Codification of the size.
431@@ -1188,11 +1185,11 @@
432 if bigEndian:
433 size = struct.unpack('!h',size)
434 if self.DEBUG == True:
435- print 'Unpack Big-endian'
436+ print ('Unpack Big-endian')
437 else:
438 size = struct.unpack('<h',size)
439 if self.DEBUG == True:
440- print 'Unpack Little-endian'
441+ print ('Unpack Little-endian')
442
443 if len(iso) != (size[0] + 2):
444 raise InvalidIso8583('This is not a valid iso!!The ISO8583 ASCII(%s) is less than the size %s!' % (len(iso[2:]),size[0]))
445
446=== modified file 'PKG-INFO'
447--- PKG-INFO 2009-08-27 15:34:49 +0000
448+++ PKG-INFO 2012-07-25 06:33:20 +0000
449@@ -1,6 +1,6 @@
450 Metadata-Version: 1.0
451 Name: ISO8583 Module
452-Version: 1.1
453+Version: 1.2
454 Summary: ISO8583 LIBRARY
455 Home-page: http://www.vulcanno.com.br/python
456 Author: Igor V. Custodio
457
458=== added file 'TODO'
459--- TODO 1970-01-01 00:00:00 +0000
460+++ TODO 2012-07-25 06:33:20 +0000
461@@ -0,0 +1,74 @@
462+Add:
463+
464+ - create a unsetBit(bitNumber) method to delete a value of a bit inside the object
465+
466+ - create a ISO8583Util Class that give some util method like:
467+ - intToBCD
468+ - BCDToInt
469+ - getTimeGMT (to bit 12)
470+ - GetDateType (to bit 13)
471+
472+Fix:
473+
474+ - ...
475+
476+Think about:
477+
478+ - Improve ... improve ... improve
479+
480+ - Add support to "BCD" sizes in LL LLL types.
481+ ASCII LL size and ASCII value inside '123456' -> '06123456'
482+ BCD LL size and ASCII value inside '123456' -> '\x06' + '123456'
483+ ASCII LLL size and ASCII value inside '123456' -> '006123456'
484+ BCD LLL size and ASCII value inside '123456' -> '\x00\x06' + '123456'
485+
486+ - Improve support to "binary" data
487+ i.setBit(3,'\x00\x01\x02')
488+
489+ - Make sense setBit(1,'xxx') ?
490+ Maybe the dialet need to have the 2º bitmap inside with no value because it's automatic that 2º be present when bit large than 64 is inside...
491+ But .. Today work :) by the way ... xxx is ignored...
492+
493+ - It's important separate the size and the value of LL and LLL types?
494+ Example, bit 2 is LL:
495+ Today -> i.setBit(2,'123') -> i.getBit(2) -> 03123
496+ Think -> i.setBit(2,'123') -> i.getBit(2) -> 123
497+ It was build in this way because the size can be important in some cases, but we can determine the size len(i.getBit(2)) ...
498+ If the partner send a ISO8583 with wrong size?
499+
500+ - Make a XML builder that convert a ISO8583 to a XML object and a XML to ISO8583...
501+ <ISO8583>
502+ <mti>0200</mti>
503+ <bitmap>600000000000000</bitmap>
504+ <bits>
505+ <bit>
506+ <number>2</number>
507+ <value>03123</value>
508+ <type>LL</type>
509+ </bit>
510+ <bit>
511+ <number>3</number>
512+ <value>300000</value>
513+ <type>N</type>
514+ </bit>
515+ </bits>
516+ </ISO8583>
517+
518+ - Use log4Python to improve debug information
519+
520+ - Support Python V3
521+
522+ - Improve errors:
523+ - validate values
524+
525+ - Improve the package name / structure
526+ - today: FROM ISO8583.ISO8583 import ISO8583
527+ - future: FROM iso8583 import ISO8583
528+
529+ - Create more examples
530+
531+ - Create benchmarks with JPOS
532+
533+ - Support EBCDIC ...
534+
535+ - ...
536\ No newline at end of file
537
538=== modified file 'debian/changelog'
539--- debian/changelog 2009-08-27 15:34:49 +0000
540+++ debian/changelog 2012-07-25 06:33:20 +0000
541@@ -1,3 +1,12 @@
542+python-iso8583 (1.2-0ubuntu1) quantal; urgency=low
543+
544+ * New upstream release.
545+ * debian/rules: Update build structure to satisfy Lintian.
546+ * Bump Standards-Version to 3.9.3.
547+ * Add ${misc:Depends} to python-iso8583 binary.
548+
549+ -- Logan Rosen <logatronico@gmail.com> Wed, 25 Jul 2012 02:25:14 -0400
550+
551 python-iso8583 (1.1-1) unstable; urgency=low
552
553 * Initial release (Closes: #539097)
554
555=== modified file 'debian/control'
556--- debian/control 2009-08-27 15:34:49 +0000
557+++ debian/control 2012-07-25 06:33:20 +0000
558@@ -1,11 +1,12 @@
559 Source: python-iso8583
560 Section: python
561 Priority: optional
562-Maintainer: Mauro Lizaur <mauro@cacavoladora.org>
563+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
564+XSBC-Original-Maintainer: Mauro Lizaur <mauro@cacavoladora.org>
565 Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
566 Build-Depends: debhelper (>= 7)
567 Build-Depends-Indep: python (>= 2.4), python-setuptools, python-support (>= 0.6.4)
568-Standards-Version: 3.8.3
569+Standards-Version: 3.9.3
570 Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-iso8583/trunk
571 Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/python-iso8583/trunk/?op=log
572 Homepage: http://code.google.com/p/iso8583py/
573@@ -13,7 +14,7 @@
574
575 Package: python-iso8583
576 Architecture: all
577-Depends: ${python:Depends}
578+Depends: ${python:Depends}, ${misc:Depends}
579 Description: library for ISO 8583 transactions
580 This library provides a pure Python interface for electronic
581 transactions using ISO 8583 ("Standard for Financial Transaction
582
583=== modified file 'debian/rules'
584--- debian/rules 2009-08-27 15:34:49 +0000
585+++ debian/rules 2012-07-25 06:33:20 +0000
586@@ -6,7 +6,9 @@
587 PYVERS=$(shell pyversions -r)
588 d=debian/python-iso8583
589
590-build: build-stamp
591+build: build-arch build-indep
592+build-arch: build-stamp
593+build-indep: build-stamp
594
595 build-stamp:
596 dh_testdir
597
598=== modified file 'doc/ISO8583.ISO8583.html'
599--- doc/ISO8583.ISO8583.html 2009-08-27 15:34:49 +0000
600+++ doc/ISO8583.ISO8583.html 2012-07-25 06:33:20 +0000
601@@ -6,7 +6,7 @@
602 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
603 <tr bgcolor="#7799ee">
604 <td valign=bottom>&nbsp;<br>
605-<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ISO8583.html"><font color="#ffffff">ISO8583</font></a>.ISO8583</strong></big></big> (version 0.2)</font></td
606+<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ISO8583.html"><font color="#ffffff">ISO8583</font></a>.ISO8583</strong></big></big> (version 1.2)</font></td
607 ><td align=right valign=bottom
608 ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C|/python25/lib/site-packages/iso8583/iso8583.py">c:\python25\lib\site-packages\iso8583\iso8583.py</a></font></td></tr></table>
609 <p><tt>(C)&nbsp;Copyright&nbsp;2009&nbsp;Igor&nbsp;V.&nbsp;Custodio<br>
610@@ -48,7 +48,39 @@
611 <font color="#000000" face="helvetica, arial"><a name="ISO8583">class <strong>ISO8583</strong></a></font></td></tr>
612
613 <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
614-<td colspan=2><tt>Main&nbsp;Class&nbsp;to&nbsp;work&nbsp;with&nbsp;<a href="#ISO8583">ISO8583</a>&nbsp;packages.<br>&nbsp;</tt></td></tr>
615+<td colspan=2><tt>Main&nbsp;Class&nbsp;to&nbsp;work&nbsp;with&nbsp;<a href="#ISO8583">ISO8583</a>&nbsp;packages.<br>
616+Used&nbsp;to&nbsp;create,&nbsp;change,&nbsp;send,&nbsp;receive,&nbsp;parse&nbsp;or&nbsp;work&nbsp;with&nbsp;ISO8593&nbsp;Package&nbsp;version&nbsp;1993.<br>
617+It's&nbsp;100%&nbsp;Python&nbsp;:)<br>
618+Enjoy&nbsp;it!<br>
619+Thanks&nbsp;to:&nbsp;Vulcanno&nbsp;IT&nbsp;Solutions&nbsp;&lt;<a href="http://www.vulcanno.com.br">http://www.vulcanno.com.br</a>&gt;<br>
620+Licence:&nbsp;GPL&nbsp;Version&nbsp;3<br>
621+More&nbsp;information:&nbsp;<a href="http://code.google.com/p/iso8583py/">http://code.google.com/p/iso8583py/</a><br>
622+&nbsp;<br>
623+Example:<br>
624+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;<a href="#ISO8583">ISO8583</a>.<a href="#ISO8583">ISO8583</a>&nbsp;import&nbsp;<a href="#ISO8583">ISO8583</a><br>
625+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;<a href="#ISO8583">ISO8583</a>.ISOErrors&nbsp;import&nbsp;*<br>
626+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
627+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso&nbsp;=&nbsp;<a href="#ISO8583">ISO8583</a>()<br>
628+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try:<br>
629+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso.<a href="#ISO8583-setMTI">setMTI</a>('0800')<br>
630+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso.<a href="#ISO8583-setBit">setBit</a>(2,2)<br>
631+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso.<a href="#ISO8583-setBit">setBit</a>(4,4)<br>
632+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso.<a href="#ISO8583-setBit">setBit</a>(12,12)<br>
633+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso.<a href="#ISO8583-setBit">setBit</a>(21,21)<br>
634+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso.<a href="#ISO8583-setBit">setBit</a>(17,17)<br>
635+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso.<a href="#ISO8583-setBit">setBit</a>(49,986)<br>
636+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso.<a href="#ISO8583-setBit">setBit</a>(99,99)<br>
637+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;ValueToLarge,&nbsp;e:<br>
638+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('Value&nbsp;too&nbsp;large&nbsp;:(&nbsp;%s'&nbsp;%&nbsp;e)<br>
639+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except&nbsp;InvalidMTI,&nbsp;i:<br>
640+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('This&nbsp;MTI&nbsp;is&nbsp;wrong&nbsp;:(&nbsp;%s'&nbsp;%&nbsp;i)<br>
641+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
642+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('The&nbsp;Message&nbsp;Type&nbsp;Indication&nbsp;is&nbsp;=&nbsp;%s'&nbsp;%iso.<a href="#ISO8583-getMTI">getMTI</a>())&nbsp;<br>
643+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
644+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('The&nbsp;Bitmap&nbsp;is&nbsp;=&nbsp;%s'&nbsp;%iso.<a href="#ISO8583-getBitmap">getBitmap</a>())&nbsp;<br>
645+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iso.<a href="#ISO8583-showIsoBits">showIsoBits</a>();<br>
646+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('This&nbsp;is&nbsp;the&nbsp;<a href="#ISO8583">ISO8583</a>&nbsp;complete&nbsp;package&nbsp;%s'&nbsp;%&nbsp;iso.<a href="#ISO8583-getRawIso">getRawIso</a>())<br>
647+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('This&nbsp;is&nbsp;the&nbsp;<a href="#ISO8583">ISO8583</a>&nbsp;complete&nbsp;package&nbsp;to&nbsp;sent&nbsp;over&nbsp;the&nbsp;TCPIP&nbsp;network&nbsp;%s'&nbsp;%&nbsp;iso.<a href="#ISO8583-getNetworkISO">getNetworkISO</a>())<br>&nbsp;</tt></td></tr>
648 <tr><td>&nbsp;</td>
649 <td width="100%">Methods defined here:<br>
650 <dl><dt><a name="ISO8583-__cmp__"><strong>__cmp__</strong></a>(self, obj2)</dt><dd><tt>Method&nbsp;that&nbsp;compare&nbsp;two&nbsp;objects&nbsp;in&nbsp;"==",&nbsp;"!="&nbsp;and&nbsp;other&nbsp;things<br>
651@@ -69,9 +101,9 @@
652 &nbsp;<br>
653 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;'Is&nbsp;equivalent?'<br>
654 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;p1&nbsp;==&nbsp;p1:<br>
655-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;'Yes&nbsp;:)'<br>
656+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('Yes&nbsp;:)')<br>
657 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else:<br>
658-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;'Noooooooooo&nbsp;:('<br>
659+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('Noooooooooo&nbsp;:(')<br>
660 &nbsp;<br>
661 @param:&nbsp;obj2&nbsp;-&gt;&nbsp;object&nbsp;that&nbsp;will&nbsp;be&nbsp;compared<br>
662 @return:&nbsp;&lt;0&nbsp;if&nbsp;is&nbsp;not&nbsp;equal,&nbsp;0&nbsp;if&nbsp;is&nbsp;equal</tt></dd></dl>
663@@ -120,7 +152,7 @@
664 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
665 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v1&nbsp;=&nbsp;p1.<a href="#ISO8583-getBitsAndValues">getBitsAndValues</a>()<br>
666 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;v&nbsp;in&nbsp;v1:<br>
667-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;'Bit&nbsp;%s&nbsp;of&nbsp;type&nbsp;%s&nbsp;with&nbsp;value&nbsp;=&nbsp;%s'&nbsp;%&nbsp;(v['bit'],v['type'],v['value'])<br>
668+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('Bit&nbsp;%s&nbsp;of&nbsp;type&nbsp;%s&nbsp;with&nbsp;value&nbsp;=&nbsp;%s'&nbsp;%&nbsp;(v['bit'],v['type'],v['value']))<br>
669 &nbsp;<br>
670 @return:&nbsp;array&nbsp;of&nbsp;values.</tt></dd></dl>
671
672@@ -146,7 +178,7 @@
673 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;netIso&nbsp;+=&nbsp;ascii<br>
674 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Example:&nbsp;big-endian<br>
675 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;To&nbsp;little-endian,&nbsp;replace&nbsp;'iso.<a href="#ISO8583-getNetworkISO">getNetworkISO</a>()'&nbsp;with&nbsp;'iso.<a href="#ISO8583-getNetworkISO">getNetworkISO</a>(False)'<br>
676-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;'This&nbsp;&lt;%s&gt;&nbsp;the&nbsp;same&nbsp;that&nbsp;&lt;%s&gt;'&nbsp;%&nbsp;(iso.<a href="#ISO8583-getNetworkISO">getNetworkISO</a>(),netIso)<br>
677+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('This&nbsp;&lt;%s&gt;&nbsp;the&nbsp;same&nbsp;that&nbsp;&lt;%s&gt;'&nbsp;%&nbsp;(iso.<a href="#ISO8583-getNetworkISO">getNetworkISO</a>(),netIso))<br>
678 &nbsp;<br>
679 @param:&nbsp;bigEndian&nbsp;(True|False)&nbsp;-&gt;&nbsp;if&nbsp;you&nbsp;want&nbsp;that&nbsp;the&nbsp;size&nbsp;be&nbsp;represented&nbsp;in&nbsp;this&nbsp;way.&nbsp;<br>
680 @return:&nbsp;size&nbsp;+&nbsp;ASCII&nbsp;<a href="#ISO8583">ISO8583</a>&nbsp;package&nbsp;ready&nbsp;to&nbsp;go&nbsp;to&nbsp;the&nbsp;network!<br>
681@@ -162,7 +194,7 @@
682 iso.<a href="#ISO8583-setBit">setBit</a>(17,17)<br>
683 iso.<a href="#ISO8583-setBit">setBit</a>(99,99)<br>
684 str&nbsp;=&nbsp;iso.<a href="#ISO8583-getRawIso">getRawIso</a>()<br>
685-print&nbsp;'This&nbsp;is&nbsp;the&nbsp;ASCII&nbsp;package&nbsp;%s'&nbsp;%&nbsp;str&nbsp;<br>
686+print&nbsp;('This&nbsp;is&nbsp;the&nbsp;ASCII&nbsp;package&nbsp;%s'&nbsp;%&nbsp;str)&nbsp;<br>
687 output&nbsp;(print)&nbsp;-&gt;&nbsp;This&nbsp;is&nbsp;the&nbsp;ASCII&nbsp;package&nbsp;0800d010800000000000000000002000000001200000000000400001200170299<br>
688 &nbsp;<br>
689 @return:&nbsp;str&nbsp;with&nbsp;complete&nbsp;ASCII&nbsp;<a href="#ISO8583">ISO8583</a><br>
690@@ -205,7 +237,7 @@
691 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;'This&nbsp;ISO&nbsp;has&nbsp;bits:'<br>
692 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v3&nbsp;=&nbsp;i2.<a href="#ISO8583-getBitsAndValues">getBitsAndValues</a>()<br>
693 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;v&nbsp;in&nbsp;v3:<br>
694-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;'Bit&nbsp;%s&nbsp;of&nbsp;type&nbsp;%s&nbsp;with&nbsp;value&nbsp;=&nbsp;%s'&nbsp;%&nbsp;(v['bit'],v['type'],v['value'])<br>
695+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('Bit&nbsp;%s&nbsp;of&nbsp;type&nbsp;%s&nbsp;with&nbsp;value&nbsp;=&nbsp;%s'&nbsp;%&nbsp;(v['bit'],v['type'],v['value']))<br>
696 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
697 @param:&nbsp;str&nbsp;-&gt;&nbsp;complete&nbsp;<a href="#ISO8583">ISO8583</a>&nbsp;string<br>
698 @raise:&nbsp;InvalidIso8583&nbsp;Exception</tt></dd></dl>
699@@ -236,7 +268,7 @@
700 #newIso.<a href="#ISO8583-setIsoContent">setIsoContent</a>(netIso[2:size])<br>
701 arr&nbsp;=&nbsp;newIso.<a href="#ISO8583-getBitsAndValues">getBitsAndValues</a>()<br>
702 for&nbsp;v&nbsp;in&nbsp;arr:<br>
703-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;'Bit&nbsp;%s&nbsp;Type&nbsp;%s&nbsp;Value&nbsp;=&nbsp;%s'&nbsp;%&nbsp;(v['bit'],v['type'],v['value'])<br>
704+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;('Bit&nbsp;%s&nbsp;Type&nbsp;%s&nbsp;Value&nbsp;=&nbsp;%s'&nbsp;%&nbsp;(v['bit'],v['type'],v['value']))<br>
705 &nbsp;<br>
706 @param:&nbsp;iso&nbsp;-&gt;&nbsp;str&nbsp;that&nbsp;represents&nbsp;size&nbsp;+&nbsp;ASCII&nbsp;<a href="#ISO8583">ISO8583</a>&nbsp;package<br>
707 @param:&nbsp;bigEndian&nbsp;(True|False)&nbsp;-&gt;&nbsp;Codification&nbsp;of&nbsp;the&nbsp;size.<br>
708@@ -287,7 +319,7 @@
709 <tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
710 <td width="100%"><strong>__author__</strong> = 'Igor Vitorio Custodio &lt;igorvc@vulcanno.com.br&gt;'<br>
711 <strong>__licence__</strong> = 'GPL V3'<br>
712-<strong>__version__</strong> = '0.2'</td></tr></table><p>
713+<strong>__version__</strong> = '1.2'</td></tr></table><p>
714 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
715 <tr bgcolor="#7799ee">
716 <td colspan=3 valign=bottom>&nbsp;<br>
717
718=== added file 'doc/index.html'
719--- doc/index.html 1970-01-01 00:00:00 +0000
720+++ doc/index.html 2012-07-25 06:33:20 +0000
721@@ -0,0 +1,10 @@
722+<html>
723+<head>
724+<title>One second ...</title>
725+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
726+<meta http-equiv="refresh" content="0;URL=ISO8583.html">
727+</head>
728+
729+<body>
730+</body>
731+</html>
732\ No newline at end of file
733
734=== modified file 'examples/echoClient.py'
735--- examples/echoClient.py 2009-08-27 15:34:49 +0000
736+++ examples/echoClient.py 2012-07-25 06:33:20 +0000
737@@ -26,7 +26,7 @@
738
739
740 # Configure the client
741-serverIP = "192.168.0.100"
742+serverIP = "192.168.0.103"
743 serverPort = 8583
744 numberEcho = 5
745 timeBetweenEcho = 5 # in seconds
746@@ -50,7 +50,7 @@
747 continue
748 break
749 if s is None:
750- print 'Could not connect :('
751+ print ('Could not connect :(')
752 sys.exit(1)
753
754
755@@ -67,19 +67,19 @@
756 try:
757 message = iso.getNetworkISO()
758 s.send(message)
759- print 'Sending ... %s' % message
760+ print ('Sending ... %s' % message)
761 ans = s.recv(2048)
762- print "\nInput ASCII |%s|" % ans
763+ print ("\nInput ASCII |%s|" % ans)
764 isoAns = ISO8583()
765 isoAns.setNetworkISO(ans)
766 v1 = isoAns.getBitsAndValues()
767 for v in v1:
768- print 'Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value'])
769+ print ('Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value']))
770
771 if isoAns.getMTI() == '0810':
772- print "\tThat's great !!! The server understand my message !!!"
773+ print ("\tThat's great !!! The server understand my message !!!")
774 else:
775- print "The server dosen't understand my message!"
776+ print ("The server dosen't understand my message!")
777
778 except InvalidIso8583, ii:
779 print ii
780@@ -92,19 +92,19 @@
781 try:
782 message = iso.getNetworkISO(False)
783 s.send(message)
784- print 'Sending ... %s' % message
785+ print ('Sending ... %s' % message)
786 ans = s.recv(2048)
787- print "\nInput ASCII |%s|" % ans
788+ print ("\nInput ASCII |%s|" % ans)
789 isoAns = ISO8583()
790 isoAns.setNetworkISO(ans,False)
791 v1 = isoAns.getBitsAndValues()
792 for v in v1:
793- print 'Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value'])
794+ print ('Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value']))
795
796 if isoAns.getMTI() == '0810':
797- print "\tThat's great !!! The server understand my message !!!"
798+ print ("\tThat's great !!! The server understand my message !!!")
799 else:
800- print "The server dosen't understand my message!"
801+ print ("The server dosen't understand my message!")
802
803 except InvalidIso8583, ii:
804 print ii
805@@ -114,6 +114,6 @@
806
807
808
809-print 'Closing...'
810+print ('Closing...')
811 s.close()
812
813\ No newline at end of file
814
815=== modified file 'examples/echoServer.py'
816--- examples/echoServer.py 2009-08-27 15:34:49 +0000
817+++ examples/echoServer.py 2012-07-25 06:33:20 +0000
818@@ -23,7 +23,7 @@
819 from socket import *
820
821 # Configure the server
822-serverIP = "192.168.0.100"
823+serverIP = "192.168.0.103"
824 serverPort = 8583
825 maxConn = 5
826 bigEndian = True
827@@ -46,7 +46,7 @@
828 # receive message
829 isoStr = connection.recv(2048)
830 if isoStr:
831- print "\nInput ASCII |%s|" % isoStr
832+ print ("\nInput ASCII |%s|" % isoStr)
833 pack = ISO8583()
834 #parse the iso
835 try:
836@@ -57,12 +57,12 @@
837
838 v1 = pack.getBitsAndValues()
839 for v in v1:
840- print 'Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value'])
841+ print ('Bit %s of type %s with value = %s' % (v['bit'],v['type'],v['value']))
842
843 if pack.getMTI() == '0800':
844- print "\tThat's great !!! The client send a correct message !!!"
845+ print ("\tThat's great !!! The client send a correct message !!!")
846 else:
847- print "The client dosen't send the correct message!"
848+ print ("The client dosen't send the correct message!")
849 break
850
851
852@@ -70,7 +70,7 @@
853 print ii
854 break
855 except:
856- print 'Something happened!!!!'
857+ print ('Something happened!!!!')
858 break
859
860 #send answer
861@@ -81,11 +81,11 @@
862 else:
863 ans = pack.getNetworkISO(False)
864
865- print 'Sending answer %s' % ans
866+ print ('Sending answer %s' % ans)
867 connection.send(ans)
868
869 else:
870 break
871 # close socket
872 connection.close()
873- print "Closed..."
874\ No newline at end of file
875+ print ("Closed...")
876\ No newline at end of file
877
878=== modified file 'examples/example1.py'
879--- examples/example1.py 2009-08-27 15:34:49 +0000
880+++ examples/example1.py 2012-07-25 06:33:20 +0000
881@@ -29,13 +29,13 @@
882 p = ISO8583()
883 #some string describing the transation type
884 transation = "200"
885-print 'Setting transation type to %s' % transation
886+print ('Setting transation type to %s' % transation)
887 p.setTransationType(transation)
888 # Is the same that:
889 #p.setMTI(transation)
890
891 #Some tests and
892-print 'Setting bits'
893+print ('Setting bits')
894
895 p.setBit(3,"100000")
896 p.setBit(4,1200)
897@@ -53,47 +53,47 @@
898 try:
899 p.setBit(126,"00000000000000105")
900 except ValueToLarge:
901- print '\t\tSomething happening!!!! The Exception! So, bit 126 is not set!!!!'
902+ print ('\t\tSomething happening!!!! The Exception! So, bit 126 is not set!!!!')
903 #if want more information ...
904 #traceback.print_exc()
905
906 #show hex bitmap
907-print 'Bitmap in HEX'
908+print ('Bitmap in HEX')
909 p.showBitmap()
910
911 #Show bits
912-print 'Bits with values'
913+print ('Bits with values')
914 p.showIsoBits()
915
916 # Show raw ASCII ISO
917-print 'The package is -> '
918+print ('The package is -> ')
919 p.showRawIso()
920
921 # Getting bits...
922-print '\n\n\n------------------------------------------\n'
923+print ('\n\n\n------------------------------------------\n')
924
925-print 'Getting bits'
926+print ('Getting bits')
927 try:
928- print 'Bit 7 is there? %s' % p.getBit(7)
929- print 'Bit 32 is there? %s' % p.getBit(32)
930+ print ('Bit 7 is there? %s' % p.getBit(7))
931+ print ('Bit 32 is there? %s' % p.getBit(32))
932 except:
933- print 'Something is bad...'
934+ print ('Something is bad...')
935
936 # Testing exceptions...
937 try:
938- print 'Bit 45 is there? %s' % p.getBit(45)
939+ print ('Bit 45 is there? %s' % p.getBit(45))
940 except:
941- print "No, this bit is not there :)"
942+ print ("No, this bit is not there :)")
943
944 try:
945- print 'Bit 27 is there? %s' % p.getBit(27)
946+ print ('Bit 27 is there? %s' % p.getBit(27))
947 except BitNotSet, bns:
948 print bns
949
950
951 #More exceptions...
952-print '\n\n\n------------------------------------------\n'
953-print 'Exeptions....'
954+print ('\n\n\n------------------------------------------\n')
955+print ('Exceptions....')
956
957 iso = ISO8583()
958 try:
959@@ -106,9 +106,9 @@
960 iso.setBit(49,9861) # this bit is wrong ...
961 iso.setBit(99,99)
962 except ValueToLarge, e:
963- print 'Value too large :( %s' % e
964+ print ('Value too large :( %s' % e)
965 except InvalidMTI, i:
966- print 'This MTI is wrong :( %s' % i
967+ print ('This MTI is wrong :( %s' % i)
968
969
970
971
972=== modified file 'examples/example2.py'
973--- examples/example2.py 2009-08-27 15:34:49 +0000
974+++ examples/example2.py 2012-07-25 06:33:20 +0000
975@@ -35,8 +35,8 @@
976 p2.setBit(17,17)
977 p2.setBit(99,99)
978
979-print 'The MTI is = %s' %p2.getMTI()
980-print 'The Bitmap is = %s' %p2.getBitmap()
981+print ('The MTI is = %s' %p2.getMTI())
982+print ('The Bitmap is = %s' %p2.getBitmap())
983
984 #Showing bits...
985 p2.showIsoBits();
986@@ -44,8 +44,8 @@
987 #Save the ASCII ISO value without size
988 iso = p2.getRawIso()
989
990-print '\n\n\n------------------------------------------\n'
991-print 'This is the ISO <%s> that will be interpreted' % iso
992+print ('\n\n\n------------------------------------------\n')
993+print ('This is the ISO <%s> that will be interpreted' % iso)
994
995 # New ISO
996 i = ISO8583()
997@@ -53,21 +53,21 @@
998 i.setIsoContent(iso)
999
1000 # Showing that everything is ok
1001-print 'The MTI is = %s' %i.getMTI()
1002-print 'The Bitmap is = %s' %i.getBitmap()
1003-print 'Show bits inside the package'
1004+print ('The MTI is = %s' %i.getMTI())
1005+print ('The Bitmap is = %s' %i.getBitmap())
1006+print ('Show bits inside the package')
1007 i.showIsoBits()
1008
1009 # Using == to compare ISOS's
1010-print 'Compare ISOs ...'
1011+print ('Compare ISOs ...')
1012 if i == p2:
1013- print 'They are equivalent!'
1014+ print ('They are equivalent!')
1015
1016 else:
1017- print 'The are differente'
1018+ print ('The are differente')
1019
1020 # More example...
1021-print '\n\n\n------------------------------------------\n'
1022+print ('\n\n\n------------------------------------------\n')
1023
1024 i3=ISO8583()
1025 i3.setMTI('0800')
1026@@ -79,6 +79,6 @@
1027
1028 i3.showIsoBits()
1029
1030-print 'This is the pack %s' %i3.getRawIso()
1031+print ('This is the pack %s' %i3.getRawIso())
1032
1033
1034
1035=== modified file 'examples/example3.py'
1036--- examples/example3.py 2009-08-27 15:34:49 +0000
1037+++ examples/example3.py 2012-07-25 06:33:20 +0000
1038@@ -36,41 +36,41 @@
1039 p2.setBit(17,17)
1040 p2.setBit(49,986)
1041 p2.setBit(99,99)
1042-print 'MTI = %s' %p2.getMTI()
1043-print 'Bitmap = %s' %p2.getBitmap()
1044+print ('MTI = %s' %p2.getMTI())
1045+print ('Bitmap = %s' %p2.getBitmap())
1046 p2.showIsoBits();
1047
1048
1049 iso = p2.getRawIso()
1050 #Show debug information of the parsing function
1051-print '\n\n\n------------------------------------------\n'
1052-print 'Parsing ... <%s> ' % iso
1053+print ('\n\n\n------------------------------------------\n')
1054+print ('Parsing ... <%s> ' % iso)
1055
1056
1057 i = ISO8583()
1058 i.setIsoContent(iso)
1059 #Show information ... to compare
1060-print 'MTI = %s' %i.getMTI()
1061-print 'Bitmap = %s' %i.getBitmap()
1062-print 'Here we have bits'
1063+print ('MTI = %s' %i.getMTI())
1064+print ('Bitmap = %s' %i.getBitmap())
1065+print ('Here we have bits')
1066 i.showIsoBits()
1067
1068
1069-print 'This is the bits and values (1)'
1070+print ('This is the bits and values (1)')
1071 v1 = p2.getBitsAndValues()
1072-print '\n%s\n' %v1
1073+print ('\n%s\n' %v1)
1074
1075-print 'This is the bits and values (2)'
1076+print ('This is the bits and values (2)')
1077 v2 = i.getBitsAndValues()
1078-print '\n%s\n' %v2
1079+print ('\n%s\n' %v2)
1080
1081-print 'One way of printing the information ...!'
1082+print ('One way of printing the information ...!')
1083 for v in v1:
1084- print 'Bit %s of type %s has value = %s' % (v['bit'],v['type'],v['value'])
1085-
1086-
1087-print 'Another way...'
1088+ print ('Bit %s of type %s has value = %s' % (v['bit'],v['type'],v['value']))
1089+
1090+
1091+print ('Another way...')
1092 for v in range(0,len(v2)):
1093- print 'Bit %s of type %s has value = %s' % (v2[v]['bit'],v2[v]['type'],v2[v]['value'])
1094+ print ('Bit %s of type %s has value = %s' % (v2[v]['bit'],v2[v]['type'],v2[v]['value']))
1095
1096
1097
1098=== modified file 'examples/example4.py'
1099--- examples/example4.py 2009-08-27 15:34:49 +0000
1100+++ examples/example4.py 2012-07-25 06:33:20 +0000
1101@@ -43,32 +43,33 @@
1102 '''
1103 #i2 = ISO8583(debug=True)
1104 i2 = ISO8583()
1105-# in this case, we need to redefine a bit because default bit 42 is LL and in this especification is "N"
1106-# the rest remain, so we use get :)
1107-i2.redefineBit(42, '42', i2.getLargeBitName(42), 'N', i2.getBitLimit(42), i2.getBitValueType(42) )
1108-
1109
1110 iso2 = '0210B238000102C080040000000000000002100000000000001700010814465469421614465701081100301000000N399915444303500019991544986020 Value not allowed!!009000095492'
1111-print '\n\n\n------------------------------------------\n'
1112-print 'This is the ISO <%s> parse it!' % iso2
1113+print ('\n\n\n------------------------------------------\n')
1114+print ('This is the ISO <%s> parse it!' % iso2)
1115
1116 i2.setIsoContent(iso2)
1117-print 'Bitmap = %s' %i2.getBitmap()
1118-print 'MTI = %s' %i2.getMTI()
1119+print ('Bitmap = %s' %i2.getBitmap())
1120+print ('MTI = %s' %i2.getMTI())
1121
1122-print 'Bits'
1123+print ('Bits')
1124 v3 = i2.getBitsAndValues()
1125 for v in v3:
1126- print '(1) Bit %s of type %s and value = %s' % (v['bit'],v['type'],v['value'])
1127+ print ('(1) Bit %s of type %s and value = %s' % (v['bit'],v['type'],v['value']))
1128
1129
1130+# in this case, we need to redefine a bit because default bit 42 is A and in this especification is "N"
1131+# the rest remain, so we use get's to copy original values :)
1132+i2.redefineBit(42, '42', i2.getLargeBitName(42), 'N', i2.getBitLimit(42), i2.getBitValueType(42) )
1133+print ('\nBit 42 redefined...\n')
1134+
1135 i3 = ISO8583(iso=iso2)
1136-print 'Bitmap = %s' %i3.getBitmap()
1137-print 'MTI = %s' %i3.getMTI()
1138+print ('Bitmap = %s' %i3.getBitmap())
1139+print ('MTI = %s' %i3.getMTI())
1140
1141-print 'Bits inside'
1142+print ('Bits inside')
1143 v4 = i3.getBitsAndValues()
1144 for v in v4:
1145- print '(2) Bit %s of type %s and value = %s' % (v['bit'],v['type'],v['value'])
1146+ print ('(2) Bit %s of type %s and value = %s' % (v['bit'],v['type'],v['value']))
1147
1148
1149
1150=== modified file 'setup.py'
1151--- setup.py 2009-08-27 15:34:49 +0000
1152+++ setup.py 2012-07-25 06:33:20 +0000
1153@@ -1,8 +1,9 @@
1154 #!/usr/bin/env python
1155
1156 from distutils.core import setup
1157+
1158 setup(name='ISO8583 Module',
1159- version='1.1',
1160+ version='1.2',
1161 description='ISO8583 LIBRARY',
1162 author='Igor V. Custodio',
1163 author_email='igorvc@vulcanno.com.br',

Subscribers

People subscribed via source and target branches

to all changes: