예제 #1
0
파일: document.py 프로젝트: khairy/editxt
 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
예제 #2
0
파일: document.py 프로젝트: editxt/editxt
 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
예제 #3
0
파일: document.py 프로젝트: khairy/editxt
 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
예제 #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
예제 #5
0
파일: test_util.py 프로젝트: khairy/editxt
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