spostatui script in virtualenv
This commit is contained in:
@@ -6,7 +6,6 @@
|
|||||||
"INworkPath": "C://",
|
"INworkPath": "C://",
|
||||||
"OUTworkPath": "C://",
|
"OUTworkPath": "C://",
|
||||||
"fileList": [
|
"fileList": [
|
||||||
"bdlog.txt"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"docStruct": {
|
"docStruct": {
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "v1.3",
|
|
||||||
"paths": {
|
|
||||||
"lastUsed": "spiripacchio.json",
|
|
||||||
"configurationPath": "./conf/",
|
|
||||||
"INworkPath": "D:/Emanuele/Documenti/workspace/bananaSPLIT/TestFiles/FileBastardi",
|
|
||||||
"OUTworkPath": "H:/",
|
|
||||||
"fileList": []
|
|
||||||
},
|
|
||||||
"docStruct": {
|
|
||||||
"fileVersNew": true,
|
|
||||||
"language": "English",
|
|
||||||
"languageIdx": 1,
|
|
||||||
"docSep": "\\s*Copyright [(0-9)]+",
|
|
||||||
"beginOfDocument": "\\s*Body",
|
|
||||||
"endOfDocument": "\\s*End of Document",
|
|
||||||
"dateFormat": "{month} {day:d}, {year:d}{}",
|
|
||||||
"outPrefix": "",
|
|
||||||
"outSuffix": "",
|
|
||||||
"outExt": ".txt",
|
|
||||||
"outDateType": "jpn",
|
|
||||||
"outNameFormat": "",
|
|
||||||
"outDate": true,
|
|
||||||
"outTitle": true,
|
|
||||||
"outNumber": true,
|
|
||||||
"numberPos": 1,
|
|
||||||
"datePos": 2,
|
|
||||||
"titlePos": 3,
|
|
||||||
"maxTitleLen": 16,
|
|
||||||
"outNameSep": "-",
|
|
||||||
"customSep": "=",
|
|
||||||
"dateFormats": {
|
|
||||||
"jpn": "{year:04d}{month:02d}{day:02d}",
|
|
||||||
"it": "{day:02d}{month:02d}{year:04d}",
|
|
||||||
"usa": "{month:02d}{year:04d}{day:02d}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"settings": {
|
|
||||||
"winW": 800,
|
|
||||||
"winH": 700,
|
|
||||||
"encoding": "windows-1252",
|
|
||||||
"monthPosition": 0,
|
|
||||||
"getNewsPaperName": true,
|
|
||||||
"nameNotFoundStr": "ND",
|
|
||||||
"includeTitle": true,
|
|
||||||
"removeDuplicates": true,
|
|
||||||
"showSkipped": false,
|
|
||||||
"showRemovedDuplicates": false,
|
|
||||||
"loadTXT": true,
|
|
||||||
"loadDOCX": false,
|
|
||||||
"removeOldFiles": true,
|
|
||||||
"saveSeparateFiles": true,
|
|
||||||
"saveBodyFile": true,
|
|
||||||
"saveBodyNumber": true,
|
|
||||||
"delLF": false,
|
|
||||||
"delWordBreak": true,
|
|
||||||
"delChars": [
|
|
||||||
"'",
|
|
||||||
"@",
|
|
||||||
"#",
|
|
||||||
"$",
|
|
||||||
"%",
|
|
||||||
"^",
|
|
||||||
"&"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,23 +11,27 @@ def updateInterfaces():
|
|||||||
command = r"pyuic5.exe "+f
|
command = r"pyuic5.exe "+f
|
||||||
print(command)
|
print(command)
|
||||||
rv = subprocess.run(command, capture_output=True)
|
rv = subprocess.run(command, capture_output=True)
|
||||||
fp = open(r".\\CompiledUI\\"+f.replace("ui","py"), 'w')
|
if rv.returncode == 0:
|
||||||
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
|
fp = open(r".\\CompiledUI\\"+f.replace("ui","py"), 'w')
|
||||||
fp.close()
|
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
|
||||||
|
fp.close()
|
||||||
|
else:
|
||||||
|
print("Command Failure")
|
||||||
|
|
||||||
def updateResources():
|
def updateResources():
|
||||||
command = r'pyrcc5.exe '+'.\\resources\\resources.qrc'
|
command = r'pyrcc5.exe '+'.\\resources\\resources.qrc'
|
||||||
print (command)
|
print (command)
|
||||||
rv = subprocess.run(command, capture_output=True)
|
rv = subprocess.run(command, capture_output=True)
|
||||||
fp = open(r".\\compiledUI\\resources_rc.py", 'w')
|
if rv.returncode == 0:
|
||||||
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
|
fp = open(r".\\compiledUI\\resources_rc.py", 'w')
|
||||||
fp.close()
|
fp.write(str(rv.stdout, encoding='utf-8').replace('\r', ''))
|
||||||
|
fp.close()
|
||||||
|
else:
|
||||||
|
print("Command Failure")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
os.chdir("..\\UserInterface")
|
|
||||||
print(os.getcwd())
|
print(os.getcwd())
|
||||||
|
os.chdir(r"..\spex\userInterface")
|
||||||
updateInterfaces()
|
updateInterfaces()
|
||||||
updateResources()
|
updateResources()
|
||||||
|
|
||||||
|
|
||||||
pass
|
pass
|
||||||
@@ -5,14 +5,11 @@ Created on 10 apr 2020
|
|||||||
'''
|
'''
|
||||||
import os,glob
|
import os,glob
|
||||||
import subprocess
|
import subprocess
|
||||||
from bananaSPLIT.scripts.compileUI import updateResources
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
tsfiles = glob.glob("..\\UserInterface\\resources\\translations\\*.ts")
|
tsfiles = glob.glob("..\\UserInterface\\resources\\translations\\*.ts")
|
||||||
for ts in tsfiles:
|
for ts in tsfiles:
|
||||||
tso = "..\\UserInterface\\resources\\translations\\"+os.path.splitext((os.path.split(ts)[1]))[0]+".qm"
|
tso = "..\\SPEx\\userInterface\\resources\\translations\\"+os.path.splitext((os.path.split(ts)[1]))[0]+".qm"
|
||||||
subprocess.run(f'lrelease.exe {ts} -qm {tso}')
|
subprocess.run(f'lrelease.exe {ts} -qm {tso}')
|
||||||
os.chdir("..\\UserInterface")
|
os.chdir("..\\SPEx\\userInterface")
|
||||||
#print(os.getcwd())
|
|
||||||
#updateResources()
|
|
||||||
pass
|
pass
|
||||||
@@ -9,12 +9,12 @@ langs = ["en"]
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
uifiles = glob.glob("..\\*\\*.ui", recursive=True)
|
uifiles = glob.glob("..\\*\\*.ui", recursive=True)
|
||||||
pyfiles = ['..\\guimain.py','..\\libbananasplit\\libsplit.py','..\\libbananasplit\\libconfload.py']
|
pyfiles = ['..\\SPEx\\guimain.py','..\\SPEx\\libbananasplit\\libsplit.py','..\\SPEx\\libbananasplit\\libconfload.py']
|
||||||
for l in langs:
|
for l in langs:
|
||||||
for ui in uifiles:
|
for ui in uifiles:
|
||||||
uio = "..\\UserInterface\\resources\\translations\\"+os.path.splitext((os.path.split(ui)[1]))[0]+f"_{l}.ts"
|
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}')
|
subprocess.run(f'lupdate.exe {ui} -ts {uio}')
|
||||||
for py in pyfiles:
|
for py in pyfiles:
|
||||||
pyo = "..\\UserInterface\\resources\\translations\\"+os.path.splitext((os.path.split(py)[1]))[0]+f"_{l}.ts"
|
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}'))
|
print(subprocess.run(f'pylupdate5.exe {py} -ts {pyo}'))
|
||||||
pass
|
pass
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user