def copyFile(self, link): link = _qstr(link) if link.isEmpty(): return url = QUtils.getGoodUrl(link) if url.isValid(): dst = self.getPathToFolder(Editor.FILES_FOLDER) make_dir_if_not_exist(dst) url = copy_file(unicode(url.toString(), 'utf-8')[7:], dst) return {"url":url, "name": get_name(url)}
def copyImage(self, path): return copy_file(path, self.getPathToFolder(Editor.IMG_FOLDER))