def __init__(self, gdi, *args, **kwargs): # We obviously override the init to add support for our modifications self._gdi = gdi if not gdi: print("No gdi file provided") raise GDIException("No gdi file provided") return self._dict1 = [i for i in gdi if i['lba'] == 45000][0] # That's ugly but it works self._dirname = os.path.dirname(self._dict1['filename']) self._dict2 = None if len(gdi) > self._dict1['tnum']: self._dict2 = gdi[-1] self._last_read_toc_sector = 0 # Last read TOC sector *SO FAR* self._gdifile = AppendedFiles(self._dict1, self._dict2) _ISO9660_orig.__init__(self, 'url') # So url doesn't starts with http if 'verbose' in kwargs: self._verbose = kwargs.pop('verbose') else: self._verbose = False
def __init__(self, *args, **kwargs): # We obviously override the init to add support for our modifications self._dict1 = args[0] self._dirname = os.path.dirname(self._dict1['filename']) self._dict2 = None if len(args) > 1: if type(args[1]) == type({}): self._dict2 = args[1] self._gdifile = AppendedFiles(self._dict1, self._dict2) _ISO9660_orig.__init__(self, 'url') # So url doesn't starts with http if kwargs.has_key('verbose'): self._verbose = kwargs.pop('verbose') else: self._verbose = False
def _unpack_record(self, read=0): tmp = _ISO9660_orig._unpack_record(self, read) pointer = self._gdifile.tell() # Where are we in sectors? current_pointer_pos = pointer//2048 # If we're not at the exact beginning of a sector, we add one. if pointer % 2048: current_pointer_pos += 1 if current_pointer_pos > self._last_read_toc_sector: self._last_read_toc_sector = current_pointer_pos return tmp