Skip to content

Commit 9412d4a

Browse files
committed
MDL: Add decodeBinaryPos to namespace
See merge request Karabo/Framework!7324
2 parents 538dbb2 + c1a93b3 commit 9412d4a

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

src/pythonKarabo/karabo/middlelayer/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@
6969
VectorFloat, VectorHash, VectorInt8, VectorInt16, VectorInt32, VectorInt64,
7070
VectorRegexString, VectorString, VectorStringValue, VectorUInt8,
7171
VectorUInt16, VectorUInt32, VectorUInt64, Weak, convert_old_project,
72-
daysAgo, decodeBinary, decodeXML, dictToHash, dtype_from_number,
73-
encodeBinary, encodeXML, get_array_data, get_default_value,
74-
get_descriptor_from_data, get_hash_type_from_data, get_image_data,
75-
get_instance_parent, get_timestamp, has_changes, hashToDict,
76-
hashtype_from_string, hoursAgo, is_equal, isSet, loadFromFile, minutesAgo,
77-
newest_timestamp, read_project_model, sanitize_table_schema, saveToFile,
78-
simple_deepcopy, string_from_hashtype, unit_registry as unit,
72+
daysAgo, decodeBinary, decodeBinaryPos, decodeXML, dictToHash,
73+
dtype_from_number, encodeBinary, encodeXML, get_array_data,
74+
get_default_value, get_descriptor_from_data, get_hash_type_from_data,
75+
get_image_data, get_instance_parent, get_timestamp, has_changes,
76+
hashToDict, hashtype_from_string, hoursAgo, is_equal, isSet, loadFromFile,
77+
minutesAgo, newest_timestamp, read_project_model, sanitize_table_schema,
78+
saveToFile, simple_deepcopy, string_from_hashtype, unit_registry as unit,
7979
write_project_model, writeBinary, writeXML)

src/pythonKarabo/karabo/native/data/bin_reader.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ def read(self, data):
3131
return read_binary_hash(self)
3232

3333

34-
def decodeBinary(data):
34+
def decodeBinary(data: bytes):
35+
"""Decode a binary hash object `data` and return a Hash"""
3536
parser = BinaryParser()
3637
return parser.read(data)
3738

3839

39-
def decodeBinaryPos(data):
40+
def decodeBinaryPos(data: bytes):
41+
"""Decode a binary hash object `data`
42+
43+
This function will return a decoded Hash as well as the position of the
44+
parser in a tuple.
45+
"""
4046
parser = BinaryParser()
4147
return parser.read(data), parser.pos
4248

0 commit comments

Comments
 (0)