def convert_all_files_in_path(self, path):
if not os.path.exists(path):
print("'%s': Path doesn't exists. Skipping" % path)
return
count = 0
for filename in os.listdir(path):
full_path = os.path.join(path, filename)
only_name, ext = os.path.splitext(full_path)
cmd = None
pyfile = None
if fnmatch.fnmatch(filename, '*.ui'):
pyfile = '%s.py' % only_name
cmd = self.PYUIC
elif fnmatch.fnmatch(filename, '*.qrc'):
pyfile = '%s_rc.py' % only_name
cmd = self.PYRCC
if cmd and modified(full_path, pyfile):
cmd_string = '%s -o "%s" "%s"' % (cmd, pyfile, full_path)
os.system(cmd_string)
count += 1
print("'%s': %s converted %s files" % (path, time.ctime(time.time()), count))
评论列表
文章目录