Revert "v1" accidentaly push

This reverts commit 41927d0c.
1 parent 41927d0c
...@@ -2,35 +2,6 @@ from ISO8583.ISO8583 import ISO8583 ...@@ -2,35 +2,6 @@ from ISO8583.ISO8583 import ISO8583
class BaseISO8583(ISO8583): class BaseISO8583(ISO8583):
@property
def ack_message(self):
"""Default ack_message property for compatibility."""
return getattr(self, '_ack_message', None)
@ack_message.setter
def ack_message(self, value):
self._ack_message = value
def to_dict(self):
"""Serialize all set bits and their values to a dict."""
d = {}
for item in self.getBitsAndValues():
bit = int(item['bit'])
d[bit] = self.getBit(bit)
d['MTI'] = self.getMTI()
return d
@classmethod
def from_dict(cls, d):
"""Create a new ISO8583 object from a dict of bits and values."""
mti = d.get('MTI')
obj = cls()
if mti:
obj.setMTI(mti)
for bit, value in d.items():
if bit == 'MTI':
continue
obj.setBit(int(bit), value)
return obj
def __init__(self, from_iso=None, debug=False): def __init__(self, from_iso=None, debug=False):
ISO8583.__init__(self, debug=debug) ISO8583.__init__(self, debug=debug)
self.from_iso = from_iso self.from_iso = from_iso
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!