modulitiz-micro 2.38.0__py311-none-any.whl → 2.38.1__py311-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- modulitiz_micro/rete/ModuloNetworking.py +19 -14
- modulitiz_micro/util/wheel/ModuloBuildWheel.py +6 -5
- modulitiz_micro/util/wheel/ModuloCheckTestNamingConvention.py +7 -1
- {modulitiz_micro-2.38.0.dist-info → modulitiz_micro-2.38.1.dist-info}/METADATA +1 -1
- {modulitiz_micro-2.38.0.dist-info → modulitiz_micro-2.38.1.dist-info}/RECORD +8 -8
- {modulitiz_micro-2.38.0.dist-info → modulitiz_micro-2.38.1.dist-info}/LICENSE +0 -0
- {modulitiz_micro-2.38.0.dist-info → modulitiz_micro-2.38.1.dist-info}/WHEEL +0 -0
- {modulitiz_micro-2.38.0.dist-info → modulitiz_micro-2.38.1.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
import os
|
2
|
+
import re
|
2
3
|
import socket
|
3
4
|
from contextlib import closing
|
4
5
|
from uuid import getnode
|
@@ -46,22 +47,26 @@ class ModuloNetworking(object):
|
|
46
47
|
return False
|
47
48
|
|
48
49
|
@staticmethod
|
49
|
-
def checkPing(
|
50
|
-
#
|
51
|
-
|
50
|
+
def checkPing(ipAddress:str)->bool:
|
51
|
+
# build command
|
52
|
+
cmd="ping "
|
53
|
+
regexPercPacketsLost=r"(\d{1,3})\% "
|
52
54
|
if ModuloSystem.isWindows():
|
53
|
-
|
55
|
+
cmd+="-n"
|
56
|
+
regexPercPacketsLost=r"\("+regexPercPacketsLost
|
54
57
|
elif os.name=='posix':
|
55
|
-
|
58
|
+
cmd+="-c"
|
59
|
+
regexPercPacketsLost=r", "+regexPercPacketsLost
|
56
60
|
else:
|
57
61
|
raise EccezioneRuntime("Tipologia del sistema operativo non riconosciuta: "+os.name)
|
58
|
-
|
59
|
-
#
|
60
|
-
outputComando=ModuloStringhe.normalizzaEol(ModuloSystem.systemCallReturnOutput(
|
61
|
-
|
62
|
-
|
63
|
-
for
|
64
|
-
if ModuloStringhe.contains(
|
65
|
-
|
66
|
-
|
62
|
+
cmd+=" 1 "+ipAddress
|
63
|
+
# execute command
|
64
|
+
outputComando=ModuloStringhe.normalizzaEol(ModuloSystem.systemCallReturnOutput(cmd,None))
|
65
|
+
rows=outputComando.split("\n")
|
66
|
+
rows=ModuloListe.eliminaElementiVuoti(rows)
|
67
|
+
for row in rows:
|
68
|
+
if ModuloStringhe.contains(row, "%"):
|
69
|
+
regexOutput=re.search(regexPercPacketsLost,row)
|
70
|
+
if regexOutput is not None:
|
71
|
+
return int(regexOutput.group(1).strip())==0
|
67
72
|
return False
|
@@ -47,15 +47,15 @@ class ModuloBuildWheel(object):
|
|
47
47
|
{}""".format(ModuloColorText.GRASSETTO,msg,self.versionOld,ModuloColorText.DEFAULT))
|
48
48
|
# change dir
|
49
49
|
os.chdir(self.percorsoCartellaSource)
|
50
|
-
if self.__doUnitTests()
|
50
|
+
if self.__doUnitTests():
|
51
51
|
return
|
52
52
|
# aggiorno versione
|
53
53
|
self.moduloToml.updateVersion(self.versionNew)
|
54
54
|
# building wheel
|
55
55
|
ModuloSystem.systemCallPrintOutput(f'{self.CMD_PYTHON} -m pip install -U build twine==6.0.1',None)
|
56
56
|
print()
|
57
|
-
|
58
|
-
cmd='{} -m build --wheel --outdir "{}"'.format(self.CMD_PYTHON,
|
57
|
+
pathFolderWheel=ModuloFiles.pathJoin(self.percorsoCartellaRoot,"wheel")
|
58
|
+
cmd='{} -m build --wheel --outdir "{}"'.format(self.CMD_PYTHON,pathFolderWheel)
|
59
59
|
ModuloSystem.systemCallPrintOutput(cmd,None)
|
60
60
|
# deleting temporary dirs
|
61
61
|
print()
|
@@ -63,15 +63,16 @@ class ModuloBuildWheel(object):
|
|
63
63
|
shutil.rmtree(ModuloFiles.pathJoin(self.percorsoCartellaSource,self.moduleName+".egg-info"))
|
64
64
|
# install wheel
|
65
65
|
self.filenameWheel=self.PATTERN_NOMEFILE_WHEEL.format(self.moduleName,self.versionNew,self.moduloToml.retrieveMinPyVersion())
|
66
|
-
percorsoWheel=ModuloFiles.pathJoin(
|
66
|
+
percorsoWheel=ModuloFiles.pathJoin(pathFolderWheel,self.filenameWheel)
|
67
67
|
cmd='{} -m pip install -U "{}"'.format(self.CMD_PYTHON,percorsoWheel)
|
68
68
|
ModuloSystem.systemCallPrintOutput(cmd,None)
|
69
|
+
# upload to web
|
69
70
|
print()
|
70
71
|
print("Uploading to Pypi")
|
71
72
|
cmd='{} -m twine upload "{}"'.format(self.CMD_PYTHON,percorsoWheel)
|
72
73
|
ModuloSystem.systemCallPrintOutput(cmd,None)
|
73
74
|
# delete wheel
|
74
|
-
|
75
|
+
shutil.rmtree(pathFolderWheel)
|
75
76
|
|
76
77
|
def __doUnitTests(self) -> bool:
|
77
78
|
if self.skipUnitTest:
|
@@ -51,11 +51,14 @@ class ModuloCheckTestNamingConvention(object):
|
|
51
51
|
return
|
52
52
|
# file name must match class name
|
53
53
|
testClasses=ModuloFunzioni.getClassesFromFileSource(filenameAbs)
|
54
|
+
if len(testClasses)==0:
|
55
|
+
self.errors.append("File must contain at least 1 class: %s"%(filenameRel,))
|
56
|
+
return
|
54
57
|
if len(testClasses)>1:
|
55
58
|
self.errors.append("File must not contain more than 1 class: %s"%(filenameRel,))
|
56
59
|
return
|
57
60
|
baseFilename=ModuloFiles.getBaseFileNameAndExtension(filename)[0]
|
58
|
-
testClassName=None
|
61
|
+
testClassName:str|None=None
|
59
62
|
if not isDecorator:
|
60
63
|
testClassName=testClasses[0]
|
61
64
|
if testClassName!=baseFilename:
|
@@ -68,6 +71,9 @@ class ModuloCheckTestNamingConvention(object):
|
|
68
71
|
return
|
69
72
|
# source class name must equals class test
|
70
73
|
if not isDecorator:
|
74
|
+
if ModuloStringhe.isEmpty(testClassName):
|
75
|
+
self.errors.append("Test class name doesn't match source class name: %s"%(filenameRel,))
|
76
|
+
return
|
71
77
|
sourceClassName=ModuloFunzioni.getClassesFromFileSource(ModuloFiles.pathJoin(self.pathSource,sourceFilenameRel))[0]
|
72
78
|
if not testClassName.startswith(sourceClassName):
|
73
79
|
self.errors.append("Test class name doesn't match source class name: %s"%(filenameRel,))
|
@@ -54,7 +54,7 @@ modulitiz_micro/multithread/ModuloThreadLogger.py,sha256=oQql4C3qrqOUksvcdrgZxgW
|
|
54
54
|
modulitiz_micro/multithread/ModuloThreadWithCallbackError.py,sha256=RQWfLDssdVmXoewrWaCdVSrySjbElh2iNBqlSslg0W8,724
|
55
55
|
modulitiz_micro/nlp/ModuloNlp.py,sha256=h7ca9kVLKRcqHMK6rCVOambdpPfh-ehVSppP2nYGxVA,799
|
56
56
|
modulitiz_micro/nlp/ModuloNlpDateAndTime.py,sha256=QCURYksP4-z_u03CVzcESLp5EtdIx2GNXDNYgYOPGuU,1851
|
57
|
-
modulitiz_micro/rete/ModuloNetworking.py,sha256=
|
57
|
+
modulitiz_micro/rete/ModuloNetworking.py,sha256=3tatSHP4s2AeBBZM4nsyZFHdhlXhNIG16C1SsCb6xYk,2114
|
58
58
|
modulitiz_micro/rete/ModuloOpenVpn.py,sha256=t99ofIYhM7q3HnQrvzQbx-6JeyDQqOc1wvg7pxvYo8U,627
|
59
59
|
modulitiz_micro/rete/email/EmailBean.py,sha256=EOKLfBVqwBEkbWfywiUmk2iB5K2uVlykxsh4zB9red8,168
|
60
60
|
modulitiz_micro/rete/email/ModuloEmail.py,sha256=6roT23q15xmo_olXORF19PRwss81tQg-71gGquvs28A,2956
|
@@ -93,12 +93,12 @@ modulitiz_micro/util/spooler/eccezioni/EccezioneSpoolerFull.py,sha256=KEcDisixOS
|
|
93
93
|
modulitiz_micro/util/unittesting/AbstractOverrideTestUtil.py,sha256=5YX20I-rhl6TpRrqSdNafI1cqBAdTs2sgtOTDjzDn5k,754
|
94
94
|
modulitiz_micro/util/unittesting/AbstractTestUtil.py,sha256=AW9mCj8i_qHrigcXcvvjgdLxa-4Ce0jrwJEZqpPVBxY,297
|
95
95
|
modulitiz_micro/util/unittesting/ModuloRunUnitTest.py,sha256=_YHxjTk_t9wvlCYgS4HSQ657ht7ekSRQsH7i1aKw1LY,774
|
96
|
-
modulitiz_micro/util/wheel/ModuloBuildWheel.py,sha256=
|
97
|
-
modulitiz_micro/util/wheel/ModuloCheckTestNamingConvention.py,sha256=
|
96
|
+
modulitiz_micro/util/wheel/ModuloBuildWheel.py,sha256=OtZdKTiiU0XhrIjWaFlBx8denZXwWIe-V794YUi8WcE,4786
|
97
|
+
modulitiz_micro/util/wheel/ModuloCheckTestNamingConvention.py,sha256=ZGwMtVexRscwVEtiwxgU5ENsItcfsV2NEAcyclcLFgA,3885
|
98
98
|
modulitiz_micro/util/wheel/ModuloToml.py,sha256=774GQ8y6lyhOrT0edJPlLq4TBU7Nq4699q74deGlFW4,1205
|
99
99
|
modulitiz_micro/util/wheel/ModuloWheel.py,sha256=VRS_6kSt62qubBYzkGm91_GWzcIiD0KlSnaqhM_aQnE,338
|
100
|
-
modulitiz_micro-2.38.
|
101
|
-
modulitiz_micro-2.38.
|
102
|
-
modulitiz_micro-2.38.
|
103
|
-
modulitiz_micro-2.38.
|
104
|
-
modulitiz_micro-2.38.
|
100
|
+
modulitiz_micro-2.38.1.dist-info/LICENSE,sha256=b-Ia9Hv3N_FviXoFAXG44lDGbk4tCC0fBdduccm8nl0,1086
|
101
|
+
modulitiz_micro-2.38.1.dist-info/METADATA,sha256=F3Qr0knvwgGjNuWU7UqoZlLZta1i55imXv1TcTyz9bQ,1690
|
102
|
+
modulitiz_micro-2.38.1.dist-info/WHEEL,sha256=2aRSX09k7pmd4gPs96VOQ860h0v0t30ka6JGHtpC3BY,94
|
103
|
+
modulitiz_micro-2.38.1.dist-info/top_level.txt,sha256=ESJE0qtNJp3tbKPrffbFVjH511NSjJHxscfpdLjTpA8,16
|
104
|
+
modulitiz_micro-2.38.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|