Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, address_space):
self._as = address_space
pytsk3.Img_Info.__init__(self, "")
def __init__(self, url, sector_size):
self.URL = url
self.SECTOR_SIZE = sector_size
## Open the image
self.fd = open(url, 'rb')
if not self.fd:
raise IOError("Unable to open %s" % url)
## data cache in sectors
self.CACHE = {}
## Call the base class with an empty URL
pytsk3.Img_Info.__init__(self, '')
def __init__(self, url, sector_size):
self.URL = url
self.SECTOR_SIZE = sector_size
## Open the image
self.fd = open(url, 'r+b')
if not self.fd:
raise IOError("Unable to open %s" % url)
## Call the base class with an empty URL
pytsk3.Img_Info.__init__(self, '')
def __init__(self, url):
self.fd = oracle.open(url)
if not self.fd:
raise IOError("Unable to open %s" % url)
pytsk3.Img_Info.__init__(self, '')
def __init__(self, fd=None, progress_callback=None):
pytsk3.Img_Info.__init__(self)
self.progress_callback = progress_callback
self.fd = fd
Raises:
ValueError: if the file-like object is invalid.
"""
if not file_object:
raise ValueError('Missing file-like object.')
# pytsk3.Img_Info does not let you set attributes after initialization.
self._file_object = file_object
# Using the old parent class invocation style otherwise some versions
# of pylint complain also setting type to RAW or EXTERNAL to make sure
# Img_Info does not do detection.
tsk_img_type = getattr(
pytsk3, 'TSK_IMG_TYPE_EXTERNAL', pytsk3.TSK_IMG_TYPE_RAW)
# Note that we want url to be a binary string in Python 2 and a Unicode
# string in Python 3. Hence the string is not prefixed.
pytsk3.Img_Info.__init__(self, url='', type=tsk_img_type)
def __init__(self, url):
self.fd = oracle.open(
pyaff4.RDFURN(url), 'r')
if not self.fd:
raise IOError("Unable to open %s" % url)
pytsk3.Img_Info.__init__(self, '')