python - zip freezing PySide QFileDialog on Linux -
this code behaves different on linux(centos 7) , windows(win 10). variable src passed trough qfiledialog.getexistingdirectory()
. on windows machine after clicking ok folder qfiledialog window closes on linux machine remains frozen until zip operation done.
def zipfolders(src, dst, id=none): #pers = 100/len(os.listdir(src)) #num = 0 if id == 'zipproject': zipfile(dst, 'w', allowzip64 = true) zf: root, dirs, files in os.walk(src): f in files, dirs: s in f: if not s == []: fullpath = os.path.join(root, s) filename = fullpath.rpartition(os.path.basename(src))[2] if filename == '': filename = '.'+fullpath.rpartition(os.path.basename(src))[1] zf.write(fullpath, filename) #num += pers #self.progress.setvalue(num)
Comments
Post a Comment