def __init__(self, parent, path, selection=None): Provider.__init__(self, parent, path, selection) self._cache = {} self._file_list = [] self._zip_file = None # get icon name icon_manager = self._parent._parent.icon_manager self._protocol_icon = icon_manager.get_icon_for_file(path)
def get_monitor(self, path): """Get file system monitor for specified path""" try: result = GioMonitor(self, path) except: result = Provider.get_monitor(self, path) return result
def get_monitor(self, path): """Get file system monitor for specified path""" try: result = LocalMonitor(self, path) except MonitorError as error: result = Provider.get_monitor(self, path) return result
def real_path(self, path, relative_to=None): """Get real path based on specified parameters.""" if path.startswith('file://'): path = path[7:] if relative_to is not None and relative_to.startswith('file://'): relative_to = relative_to[7:] return Provider.real_path(self, path, relative_to)
def release_archive_handle(self): """Release archive handle when it's no longer needed.""" self._zip_file.close() Provider.release_archive_handle(self)
def set_archive_handle(self, handle): """Set archive file handle.""" Provider.set_archive_handle(self, handle) self._zip_file = zipfile.ZipFile(self._handle, 'a')