From 24fdaed8d93b70a2bf3146e4411c325b70915a61 Mon Sep 17 00:00:00 2001 From: Emanuele Date: Thu, 22 Oct 2020 15:05:49 +0200 Subject: [PATCH] spostatui script in virtualenv --- SPEx/conf/defaults.json | 1 - SPEx/conf/spiripacchio.json | 67 ------------------ {scripts => SPEx/scripts}/compileUI.py | 22 +++--- {scripts => SPEx/scripts}/convert.py | 0 {scripts => SPEx/scripts}/libtestmain.py | 0 {scripts => SPEx/scripts}/releaseLanguages.py | 7 +- {scripts => SPEx/scripts}/updateLanguages.py | 6 +- scripts/__pycache__/compileUI.cpython-37.pyc | Bin 1153 -> 0 bytes .../releaseLanguages.cpython-37.pyc | Bin 685 -> 0 bytes .../updateLanguages.cpython-37.pyc | Bin 833 -> 0 bytes 10 files changed, 18 insertions(+), 85 deletions(-) delete mode 100644 SPEx/conf/spiripacchio.json rename {scripts => SPEx/scripts}/compileUI.py (62%) rename {scripts => SPEx/scripts}/convert.py (100%) rename {scripts => SPEx/scripts}/libtestmain.py (100%) rename {scripts => SPEx/scripts}/releaseLanguages.py (53%) rename {scripts => SPEx/scripts}/updateLanguages.py (50%) delete mode 100644 scripts/__pycache__/compileUI.cpython-37.pyc delete mode 100644 scripts/__pycache__/releaseLanguages.cpython-37.pyc delete mode 100644 scripts/__pycache__/updateLanguages.cpython-37.pyc diff --git a/SPEx/conf/defaults.json b/SPEx/conf/defaults.json index 050778f..0d00d0d 100644 --- a/SPEx/conf/defaults.json +++ b/SPEx/conf/defaults.json @@ -6,7 +6,6 @@ "INworkPath": "C://", "OUTworkPath": "C://", "fileList": [ - "bdlog.txt" ] }, "docStruct": { diff --git a/SPEx/conf/spiripacchio.json b/SPEx/conf/spiripacchio.json deleted file mode 100644 index 3546491..0000000 --- a/SPEx/conf/spiripacchio.json +++ /dev/null @@ -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": [ - "'", - "@", - "#", - "$", - "%", - "^", - "&" - ] - } -} \ No newline at end of file diff --git a/scripts/compileUI.py b/SPEx/scripts/compileUI.py similarity index 62% rename from scripts/compileUI.py rename to SPEx/scripts/compileUI.py index 7f93c74..0e1ad2b 100644 --- a/scripts/compileUI.py +++ b/SPEx/scripts/compileUI.py @@ -11,23 +11,27 @@ def updateInterfaces(): command = r"pyuic5.exe "+f print(command) rv = subprocess.run(command, capture_output=True) - fp = open(r".\\CompiledUI\\"+f.replace("ui","py"), 'w') - fp.write(str(rv.stdout, encoding='utf-8').replace('\r', '')) - fp.close() + 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) - fp = open(r".\\compiledUI\\resources_rc.py", 'w') - fp.write(str(rv.stdout, encoding='utf-8').replace('\r', '')) - fp.close() + 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__': - os.chdir("..\\UserInterface") print(os.getcwd()) + os.chdir(r"..\spex\userInterface") updateInterfaces() updateResources() - - pass \ No newline at end of file diff --git a/scripts/convert.py b/SPEx/scripts/convert.py similarity index 100% rename from scripts/convert.py rename to SPEx/scripts/convert.py diff --git a/scripts/libtestmain.py b/SPEx/scripts/libtestmain.py similarity index 100% rename from scripts/libtestmain.py rename to SPEx/scripts/libtestmain.py diff --git a/scripts/releaseLanguages.py b/SPEx/scripts/releaseLanguages.py similarity index 53% rename from scripts/releaseLanguages.py rename to SPEx/scripts/releaseLanguages.py index c34c8c8..a3aeb7f 100644 --- a/scripts/releaseLanguages.py +++ b/SPEx/scripts/releaseLanguages.py @@ -5,14 +5,11 @@ Created on 10 apr 2020 ''' import os,glob import subprocess -from bananaSPLIT.scripts.compileUI import updateResources if __name__ == '__main__': tsfiles = glob.glob("..\\UserInterface\\resources\\translations\\*.ts") 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}') - os.chdir("..\\UserInterface") - #print(os.getcwd()) - #updateResources() + os.chdir("..\\SPEx\\userInterface") pass \ No newline at end of file diff --git a/scripts/updateLanguages.py b/SPEx/scripts/updateLanguages.py similarity index 50% rename from scripts/updateLanguages.py rename to SPEx/scripts/updateLanguages.py index 93611d4..84600cd 100644 --- a/scripts/updateLanguages.py +++ b/SPEx/scripts/updateLanguages.py @@ -9,12 +9,12 @@ langs = ["en"] if __name__ == '__main__': 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 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}') 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}')) pass \ No newline at end of file diff --git a/scripts/__pycache__/compileUI.cpython-37.pyc b/scripts/__pycache__/compileUI.cpython-37.pyc deleted file mode 100644 index 16f596ec6ac83cf65bf2619b40937563284871d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1153 zcmY+DO>f*b5Qa(Wb7imX^dnAzqS!+(8z74$NQ2ZUiXe6m1`MNU;uct_5oD3;$k`Q@ zAr;39?a8_3FBH4S{*3+&UVG}jr<^(?f3&5*S0jlM-sTkwl zid|6bUog~wREpZ&Iso&PGeClTcYO`U$A$wWqa(`bb%SPe48zV<*gt$R-AgR zpbS2Ug=aB`mM<|68Lh-NlktUE_^rPTZPa?FvFyp@gTUu&a(yKzGkk`5arS2G7pxIx z(?6X1cSlV*U#riXviN4C-l6FscN;}s+Xhso8(TMazBx+MT|KMIsgg(gX*w27=|p|* z_}M&Y?Bw1Pd?{8{p=DW}eB^z{hKch}rux_gHI$WgiD`~&(1kL_dC*kO*R`r#1gf6q zg>u0elvX*won*P@QCr);J5jg9PZ$~8?e-fA$WcjIRv5};Q0J%kwGC*je z6-(bD%+ruyA~bA8*}H-!mN7x=fF+0Xuj_Ltu279qP)0X^_Wq4VZ=gViAaL{fR|xJZ zuMXVJ`V0z86MR~9O%SLnf!qW2=CB7nis`R|HIj9b4U$a~ss{8)ZlMf4_>|($NIoYa zESIv4k=wj1=}*^|Kf#-ZKFPS>RWqS#enCs)ESu$Jm1Xm-(I`DK3T{APUqx9ab&+LG zXamIM(jsxVdA-VK3ReWhD_KI9hYL@XEzabBY;^`ZZ}E3CEt{$Oo=RZIna}TtIEmvJ KVXyO$hu%MeGb0uN diff --git a/scripts/__pycache__/releaseLanguages.cpython-37.pyc b/scripts/__pycache__/releaseLanguages.cpython-37.pyc deleted file mode 100644 index 399c58bfd058ff57c053b305bdc440cb5b82e7b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 685 zcma)3O>fgc5Z(1h?YK$X15#BaBp)~s1XkMvhYD2@1f)n6LZlVa%3y80)5O%?b#~Vx z_&0FiUV)M$f5}%)y>sFM8;eN5i5cyi8SU)Mo7pG5UVx1J{Ql)_$3p1aI@pM3oPjy& zlL3YZVwhPuCb+d0v07^r+gLky3YWMT!4`9_Ecp?vrN!J8Cf?#XctiB&l=y55@Vm}3 zXmK0-6=vQ6GKde*K4ShpB3-bTJ=OvL8nFPn*XXme!Whj5uMyzo4%=Qw%o?M9w|*2n zl|VJHQ1I~RFr=jnj}MOzgJ3`_JrnXId{$6iK@Q=$q!X&O;8}2Era>?IxY?~rW}d$S zB`TSMYWyTAXvUMIeh@|Rg#tO^8ssHSA(or0SWC)PPIV@@itk5S)%X54`v#lVwH?ii zx|d7Cizr>h#xnU8$sJRrg&*VLNxa!=JQQhF0M}XkUdSs|t{3$Ooxl9w)XXB=vCk-P9IBQwjJ7z?#|V- ziFZN*p7iFQ;NLMF@pCM}B?pJ!rRmWY4!J?_Yg!5c*m=m#1aP zntl3*1%?P>m^le1xUvp$D(e!LxdTjUP-nFxM|}t9&|!7fV9j?9X)uqqm_KkybMzT% z>*(c2;*GYTVcBESVpjkk`ezfIg4Q`^Q}f6oo=0y&kw{F7weJbqLX~IqER-{Y^|4heH z>?e}4vf`$#c%eaU2m@-L#tPyldq(F|NtQA@YY#>c zQ@uHSeb5MBIWH2&Cy<)`8xGY?iiNZ<8#7)PtsHchx^9iXL+i(Rx zx7Sz0%hiYLGR}q|3=iK(b)?gB=E?qco^NjK{=s#ucxrSw8Fte)o6!MiyST!;H