Exemplo n.º 1
0
 def icon(self):
     url = self.fileURL()
     key = "" if url is None else url.path()
     old_key, data = self.icon_cache
     if old_key is None or old_key != key:
         data = fetch_icon(key)
         self.icon_cache = (key, data)
     return data
Exemplo n.º 2
0
 def icon(self):
     path = self.file_path
     key = "" if path is None else path
     old_key, data = self.icon_cache
     if old_key is None or old_key != key:
         data = fetch_icon(key)
         self.icon_cache = (key, data)
     return data
Exemplo n.º 3
0
 def icon(self):
     url = self.fileURL()
     key = "" if url is None else url.path()
     old_key, data = self.icon_cache
     if old_key is None or old_key != key:
         data = fetch_icon(key)
         self.icon_cache = (key, data)
     return data
Exemplo n.º 4
0
def do_fetch_icon((path, exists)):
    if path is not None:
        path = os.path.abspath(path)
        if exists:
            assert os.path.exists(path), "path does not exist (but should): %s" % path
        else:
            assert not os.path.exists(path), "path exists (and should not): %s" % path
    data = fetch_icon(path)
    assert data is not None
Exemplo n.º 5
0
def do_fetch_icon(path_exists):
    (path, exists) = path_exists
    if path is not None:
        path = os.path.abspath(path)
        if exists:
            assert os.path.exists(path), "path does not exist (but should): %s" % path
        else:
            assert not os.path.exists(path), "path exists (and should not): %s" % path
    data = fetch_icon(path)
    assert data is not None