Esempio n. 1
0
 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)}
Esempio n. 2
0
 def __delete_unnecessary(self, attr, elem, folder):
     necesary = [get_name(e.attribute(attr)) for e in self.findAllElements(elem)]
     delete_files(self.getPathToFolder(folder), lambda f:not f in necesary)