diff options
author | Arkadiusz Bulski <arek.bulski@gmail.com> | 2018-02-16 08:24:25 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2018-03-17 14:41:40 +0100 |
commit | 4819131ff81532c06c5eccc4c70135e72ca3f7c9 (patch) | |
tree | 2f401c51f90afee69939fb74f20c9542686cb5a9 /glucometerutils/support/construct_extras.py | |
parent | construct: the construct API is significantly unstable, fix to 2.8.22 only. (diff) | |
download | glucometerutils-4819131ff81532c06c5eccc4c70135e72ca3f7c9.tar glucometerutils-4819131ff81532c06c5eccc4c70135e72ca3f7c9.tar.gz glucometerutils-4819131ff81532c06c5eccc4c70135e72ca3f7c9.tar.bz2 glucometerutils-4819131ff81532c06c5eccc4c70135e72ca3f7c9.tar.lz glucometerutils-4819131ff81532c06c5eccc4c70135e72ca3f7c9.tar.xz glucometerutils-4819131ff81532c06c5eccc4c70135e72ca3f7c9.tar.zst glucometerutils-4819131ff81532c06c5eccc4c70135e72ca3f7c9.zip |
Diffstat (limited to 'glucometerutils/support/construct_extras.py')
-rw-r--r-- | glucometerutils/support/construct_extras.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/glucometerutils/support/construct_extras.py b/glucometerutils/support/construct_extras.py index cb42105..6d4e302 100644 --- a/glucometerutils/support/construct_extras.py +++ b/glucometerutils/support/construct_extras.py @@ -23,11 +23,11 @@ class Timestamp(construct.Adapter): super(Timestamp, self).__init__(subcon) self.epoch = epoch - def _encode(self, obj, context): + def _encode(self, obj, context, path): assert isinstance(obj, datetime.datetime) epoch_date = datetime.datetime.utcfromtimestamp(self.epoch) delta = obj - epoch_date return int(delta.total_seconds()) - def _decode(self, obj, context): + def _decode(self, obj, context, path): return datetime.datetime.utcfromtimestamp(obj + self.epoch) |