ricompilate interfacce, verifica script in vscode
This commit is contained in:
@@ -6,32 +6,32 @@ Created on 24 nov 2019
|
||||
import os, glob, subprocess
|
||||
|
||||
def updateInterfaces():
|
||||
uifiles = glob.glob("*.ui")
|
||||
for f in uifiles:
|
||||
command = r"pyuic5.exe "+f
|
||||
print(command)
|
||||
rv = subprocess.run(command, capture_output=True)
|
||||
if rv.returncode == 0:
|
||||
fp = open(r".\\CompiledUI\\"+f.replace("ui","py"), 'w')
|
||||
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
|
||||
fp.close()
|
||||
else:
|
||||
print("Command Failure")
|
||||
uifiles = glob.glob("*.ui")
|
||||
for f in uifiles:
|
||||
command = r"pyuic5.exe "+f
|
||||
print(command)
|
||||
rv = subprocess.run(command, capture_output=True)
|
||||
if rv.returncode == 0:
|
||||
fp = open(r".\\CompiledUI\\"+f.replace("ui","py"), 'w')
|
||||
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
|
||||
fp.close()
|
||||
else:
|
||||
print("Command Failure")
|
||||
|
||||
def updateResources():
|
||||
command = r'pyrcc5.exe '+'.\\resources\\resources.qrc'
|
||||
print (command)
|
||||
rv = subprocess.run(command, capture_output=True)
|
||||
if rv.returncode == 0:
|
||||
fp = open(r".\\compiledUI\\resources_rc.py", 'w')
|
||||
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
|
||||
fp.close()
|
||||
else:
|
||||
print("Command Failure")
|
||||
command = r'pyrcc5.exe '+'.\\resources\\resources.qrc'
|
||||
print (command)
|
||||
rv = subprocess.run(command, capture_output=True)
|
||||
if rv.returncode == 0:
|
||||
fp = open(r".\\compiledUI\\resources_rc.py", 'w')
|
||||
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
|
||||
fp.close()
|
||||
else:
|
||||
print("Command Failure")
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(os.getcwd())
|
||||
os.chdir(r"..\spex\userInterface")
|
||||
updateInterfaces()
|
||||
updateResources()
|
||||
pass
|
||||
print(os.getcwd())
|
||||
os.chdir(r"..\spex\userInterface")
|
||||
updateInterfaces()
|
||||
updateResources()
|
||||
pass
|
||||
@@ -6,16 +6,16 @@ Created on 30 mar 2020
|
||||
import glob, docx2txt
|
||||
|
||||
if __name__ == '__main__':
|
||||
fList = glob.iglob("../TestFiles/File nuovo formato/*.docx")
|
||||
for f in fList:
|
||||
#os.remove(f.replace('.docx', '.txt'))
|
||||
print(f)
|
||||
try:
|
||||
txt=docx2txt.process(f)
|
||||
with open(f.replace('.docx', '.txt'), 'wb') as fp:
|
||||
fp.write(txt.encode('ansi'))
|
||||
fp.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
pass
|
||||
pass
|
||||
fList = glob.iglob("../TestFiles/File nuovo formato/*.docx")
|
||||
for f in fList:
|
||||
#os.remove(f.replace('.docx', '.txt'))
|
||||
print(f)
|
||||
try:
|
||||
txt=docx2txt.process(f)
|
||||
with open(f.replace('.docx', '.txt'), 'wb') as fp:
|
||||
fp.write(txt.encode('ansi'))
|
||||
fp.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
pass
|
||||
pass
|
||||
@@ -8,13 +8,13 @@ from libsplit import bananaSPLITTER
|
||||
from libfancylogger import fancyLogger
|
||||
|
||||
if __name__ == "__main__":
|
||||
logger = fancyLogger(filepath=r"./conf/loggerconf.json",fileLog=False)
|
||||
fp = open('./conf/conftest.json', 'r')
|
||||
splitter = bananaSPLITTER(fileParams=json.load(fp), logger=logger)
|
||||
fp.close()
|
||||
splitter.run()
|
||||
logger = fancyLogger(filepath=r"./conf/loggerconf.json",fileLog=False)
|
||||
fp = open('./conf/conftest.json', 'r')
|
||||
splitter = bananaSPLITTER(fileParams=json.load(fp), logger=logger)
|
||||
fp.close()
|
||||
splitter.run()
|
||||
|
||||
logger.info("\n"+"="*50+"\n\tFINITO!!!\n"+"="*50)
|
||||
logger.info("\n"+"="*50+"\n\tFINITO!!!\n"+"="*50)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ import subprocess
|
||||
langs = ["en"]
|
||||
|
||||
if __name__ == '__main__':
|
||||
uifiles = glob.glob("..\\*\\*.ui", recursive=True)
|
||||
pyfiles = ['..\\SPEx\\guimain.py','..\\SPEx\\libbananasplit\\libsplit.py','..\\SPEx\\libbananasplit\\libconfload.py']
|
||||
for l in langs:
|
||||
for ui in uifiles:
|
||||
uio = "..\\SPEx\\userInterface\\resources\\translations\\"+os.path.splitext((os.path.split(ui)[1]))[0]+f"_{l}.ts"
|
||||
subprocess.run(f'lupdate.exe {ui} -ts {uio}')
|
||||
for py in pyfiles:
|
||||
pyo = "..\\SPEx\\userInterface\\resources\\translations\\"+os.path.splitext((os.path.split(py)[1]))[0]+f"_{l}.ts"
|
||||
print(subprocess.run(f'pylupdate5.exe {py} -ts {pyo}'))
|
||||
pass
|
||||
uifiles = glob.glob("..\\*\\*.ui", recursive=True)
|
||||
pyfiles = ['..\\SPEx\\guimain.py','..\\SPEx\\libbananasplit\\libsplit.py','..\\SPEx\\libbananasplit\\libconfload.py']
|
||||
for l in langs:
|
||||
for ui in uifiles:
|
||||
uio = "..\\SPEx\\userInterface\\resources\\translations\\"+os.path.splitext((os.path.split(ui)[1]))[0]+f"_{l}.ts"
|
||||
subprocess.run(f'lupdate.exe {ui} -ts {uio}')
|
||||
for py in pyfiles:
|
||||
pyo = "..\\SPEx\\userInterface\\resources\\translations\\"+os.path.splitext((os.path.split(py)[1]))[0]+f"_{l}.ts"
|
||||
print(subprocess.run(f'pylupdate5.exe {py} -ts {pyo}'))
|
||||
pass
|
||||
Reference in New Issue
Block a user