Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_rb_blob_data(datastring, blobid):
""" Read BLOB data from datastring and return it
Parameters
----------
datastring : string
Blob Description String
blobid : int
Number of requested blob
Returns
-------
data : string
Content of blob
"""
xmltodict = util.import_optional('xmltodict')
start = 0
search_string = '', start)
xmlstring = datastring[start:end + 1]
# cheat the xml parser by making xml well-known
xmldict = xmltodict.parse(xmlstring.decode() + '')
cmpr = get_rb_blob_attribute(xmldict, 'compression')
size = int(get_rb_blob_attribute(xmldict, 'size'))
data = datastring[end + 2:end + 2 + size] # read blob data to string
# decompress if necessary
Parameters
----------
datastring : string
Blob Description String
blobid : int
Number of requested blob
Returns
-------
data : string
Content of blob
"""
xmltodict = util.import_optional('xmltodict')
start = 0
searchString = '', start)
xmlstring = datastring[start:end + 1]
# cheat the xml parser by making xml well-known
xmldict = xmltodict.parse(xmlstring.decode() + '')
cmpr = get_RB_blob_attribute(xmldict, 'compression')
size = int(get_RB_blob_attribute(xmldict, 'size'))
data = datastring[end + 2:end + 2 + size] # read blob data to string
# decompress if necessary
def decompress(data):
"""Decompression of data
Parameters
----------
data : string
(from xml) data string containing compressed data.
"""
zlib = util.import_optional('zlib')
return zlib.decompress(data)
def decompress(data):
"""Decompression of data
Parameters
----------
data : string
(from xml) data string containing compressed data.
"""
zlib = util.import_optional('zlib')
return zlib.decompress(data)