dexter has uploaded this change for review. (
https://gerrit.osmocom.org/c/python/pyosmocom/+/38288?usp=email )
Change subject: tlv/cosmetic: improve import of osmocom functions
......................................................................
tlv/cosmetic: improve import of osmocom functions
We can import osmocom and then reference build/parse_construct
using osmocom.construct.build/parse_construct.
Change-Id: I6ce3cffbce9b276de7b223d88268d35cf2706d6a
---
M src/osmocom/tlv.py
1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/88/38288/1
diff --git a/src/osmocom/tlv.py b/src/osmocom/tlv.py
index d24f2aa..93e4e87 100644
--- a/src/osmocom/tlv.py
+++ b/src/osmocom/tlv.py
@@ -21,7 +21,7 @@
import re
from typing import List, Tuple, Optional
-from osmocom.construct import build_construct, parse_construct
+import osmocom
#########################################################################
# poor man's COMPREHENSION-TLV decoder.
@@ -383,9 +383,9 @@
if self.decoded is None:
do = b''
elif self._construct:
- do = build_construct(self._construct, self.decoded, context)
+ do = osmocom.construct.build_construct(self._construct, self.decoded,
context)
elif self.__class__._construct:
- do = build_construct(self.__class__._construct, self.decoded, context)
+ do = osmocom.construct.build_construct(self.__class__._construct,
self.decoded, context)
else:
do = self._to_bytes()
self.encoded = do
@@ -402,9 +402,9 @@
if self.encoded == b'':
self.decoded = None
elif self._construct:
- self.decoded = parse_construct(self._construct, do, context=context)
+ self.decoded = osmocom.construct.parse_construct(self._construct, do,
context=context)
elif self.__class__._construct:
- self.decoded = parse_construct(self.__class__._construct, do,
context=context)
+ self.decoded = osmocom.construct.parse_construct(self.__class__._construct,
do, context=context)
else:
self.decoded = self._from_bytes(do)
return self.decoded
--
To view, visit
https://gerrit.osmocom.org/c/python/pyosmocom/+/38288?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I6ce3cffbce9b276de7b223d88268d35cf2706d6a
Gerrit-Change-Number: 38288
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>