예제 #1
0
    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)
예제 #2
0
    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
예제 #3
0
    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)
예제 #4
0
 def release_archive_handle(self):
     """Release archive handle when it's no longer needed."""
     self._zip_file.close()
     Provider.release_archive_handle(self)
예제 #5
0
 def set_archive_handle(self, handle):
     """Set archive file handle."""
     Provider.set_archive_handle(self, handle)
     self._zip_file = zipfile.ZipFile(self._handle, 'a')