naeural-client 2.6.36__py3-none-any.whl → 2.6.38__py3-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.
- naeural_client/_ver.py +1 -1
- naeural_client/bc/base.py +30 -1
- naeural_client/logging/base_logger.py +18 -1
- {naeural_client-2.6.36.dist-info → naeural_client-2.6.38.dist-info}/METADATA +1 -1
- {naeural_client-2.6.36.dist-info → naeural_client-2.6.38.dist-info}/RECORD +8 -8
- {naeural_client-2.6.36.dist-info → naeural_client-2.6.38.dist-info}/WHEEL +0 -0
- {naeural_client-2.6.36.dist-info → naeural_client-2.6.38.dist-info}/entry_points.txt +0 -0
- {naeural_client-2.6.36.dist-info → naeural_client-2.6.38.dist-info}/licenses/LICENSE +0 -0
naeural_client/_ver.py
CHANGED
naeural_client/bc/base.py
CHANGED
@@ -947,8 +947,29 @@ class BaseBlockEngine:
|
|
947
947
|
True if the current address is in the list.
|
948
948
|
|
949
949
|
"""
|
950
|
+
return self.address_in_list(self.address, lst_addresses)
|
951
|
+
|
952
|
+
def address_in_list(self, node_address, lst_addresses):
|
953
|
+
"""
|
954
|
+
Checks if the address is in the list of addresses
|
955
|
+
|
956
|
+
Parameters
|
957
|
+
----------
|
958
|
+
node_address : str
|
959
|
+
the address.
|
960
|
+
|
961
|
+
lst_addresses : list
|
962
|
+
the list of addresses.
|
963
|
+
|
964
|
+
Returns
|
965
|
+
-------
|
966
|
+
bool
|
967
|
+
True if the address is in the list.
|
968
|
+
|
969
|
+
"""
|
970
|
+
node_address = self._remove_prefix(node_address)
|
950
971
|
lst = [self._remove_prefix(x) for x in lst_addresses if x is not None]
|
951
|
-
return
|
972
|
+
return node_address in lst
|
952
973
|
|
953
974
|
@property
|
954
975
|
def address(self):
|
@@ -977,6 +998,14 @@ class BaseBlockEngine:
|
|
977
998
|
Returns a tuple with the allowed list (prefixed) and a list with names
|
978
999
|
"""
|
979
1000
|
return self._load_and_maybe_create_allowed(return_names=True, return_prefix=True)
|
1001
|
+
|
1002
|
+
|
1003
|
+
@property
|
1004
|
+
def whitelist_with_prefixes(self):
|
1005
|
+
"""
|
1006
|
+
Returns the allowed command senders (prefixed) for the current node
|
1007
|
+
"""
|
1008
|
+
return self._load_and_maybe_create_allowed(return_names=False, return_prefix=True)
|
980
1009
|
|
981
1010
|
|
982
1011
|
def maybe_remove_prefix(self, address):
|
@@ -460,20 +460,37 @@ class BaseLogger(object):
|
|
460
460
|
import platform
|
461
461
|
import subprocess
|
462
462
|
import re
|
463
|
+
import multiprocessing
|
463
464
|
str_system = platform.system()
|
464
465
|
if str_system == "Windows":
|
465
466
|
self.processor_platform = platform.processor()
|
467
|
+
|
466
468
|
elif str_system == "Darwin":
|
467
469
|
os.environ['PATH'] = os.environ['PATH'] + os.pathsep + '/usr/sbin'
|
468
470
|
command ="sysctl -n machdep.cpu.brand_string"
|
469
471
|
self.processor_platform = subprocess.check_output(command, shell=True).strip().decode('utf-8')
|
472
|
+
|
470
473
|
elif str_system == "Linux":
|
471
474
|
command = "cat /proc/cpuinfo"
|
472
475
|
all_info = subprocess.check_output(command, shell=True).decode().strip()
|
476
|
+
proc_platform = None
|
473
477
|
for line in all_info.split("\n"):
|
474
478
|
if "model name" in line:
|
475
|
-
|
479
|
+
proc_platform = re.sub( ".*model name.*:", "", line,1)
|
476
480
|
break
|
481
|
+
if proc_platform is None:
|
482
|
+
cores = multiprocessing.cpu_count()
|
483
|
+
proc_platform = "Unknown"
|
484
|
+
try:
|
485
|
+
lscpu_out = subprocess.check_output("lscpu", shell=True).decode().strip()
|
486
|
+
match_vendor = re.search(r"Vendor ID:\s+(.*)", lscpu_out)
|
487
|
+
if match_vendor:
|
488
|
+
proc_platform = match_vendor.group(1)
|
489
|
+
except:
|
490
|
+
pass
|
491
|
+
proc_platform = f"{proc_platform} {cores} cores"
|
492
|
+
#endif no model name
|
493
|
+
self.processor_platform = proc_platform
|
477
494
|
return
|
478
495
|
|
479
496
|
def get_processor_platform(self):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: naeural_client
|
3
|
-
Version: 2.6.
|
3
|
+
Version: 2.6.38
|
4
4
|
Summary: `naeural_client` is the Python SDK required for client app development for the Naeural Edge Protocol Edge Protocol framework
|
5
5
|
Project-URL: Homepage, https://github.com/NaeuralEdgeProtocol/naeural_client
|
6
6
|
Project-URL: Bug Tracker, https://github.com/NaeuralEdgeProtocol/naeural_client/issues
|
@@ -1,5 +1,5 @@
|
|
1
1
|
naeural_client/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
|
2
|
-
naeural_client/_ver.py,sha256=
|
2
|
+
naeural_client/_ver.py,sha256=JbbpDzWJLr451P7tH-8PlZSgUOeoUaYKxHEL-fLaD5s,331
|
3
3
|
naeural_client/base_decentra_object.py,sha256=C4iwZTkhKNBS4VHlJs5DfElRYLo4Q9l1V1DNVSk1fyQ,4412
|
4
4
|
naeural_client/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
|
5
5
|
naeural_client/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
|
@@ -14,7 +14,7 @@ naeural_client/base/webapp_pipeline.py,sha256=ZNGqZ36DY076XVDfGu2Q61kCt3kxIJ4Mi4
|
|
14
14
|
naeural_client/base/payload/__init__.py,sha256=y8fBI8tG2ObNfaXFWjyWZXwu878FRYj_I8GIbHT4GKE,29
|
15
15
|
naeural_client/base/payload/payload.py,sha256=x-au7l67Z_vfn_4R2C_pjZCaFuUVXHngJiGOfIAYVdE,2690
|
16
16
|
naeural_client/bc/__init__.py,sha256=FQj23D1PrY06NUOARiKQi4cdj0-VxnoYgYDEht8lpr8,158
|
17
|
-
naeural_client/bc/base.py,sha256=
|
17
|
+
naeural_client/bc/base.py,sha256=64hbp866n2DBCc7xxzEniszr4dQ-0rLKJPKIQsST0Ig,42950
|
18
18
|
naeural_client/bc/chain.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
naeural_client/bc/ec.py,sha256=qI8l7YqiS4MNftlx-tF7IZUswrSeQc7KMn5OZ0fEaJs,23370
|
20
20
|
naeural_client/certs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -58,7 +58,7 @@ naeural_client/io_formatter/default/a_dummy.py,sha256=qr9eUizQ-NN5jdXVzkaZKMaf9K
|
|
58
58
|
naeural_client/io_formatter/default/aixp1.py,sha256=MX0TeUR4APA-qN3vUC6uzcz8Pssz5lgrQWo7td5Ri1A,3052
|
59
59
|
naeural_client/io_formatter/default/default.py,sha256=gEy78cP2D5s0y8vQh4aHuxqz7D10gGfuiKF311QhrpE,494
|
60
60
|
naeural_client/logging/__init__.py,sha256=b79X45VC6c37u32flKB2GAK9f-RR0ocwP0JDCy0t7QQ,33
|
61
|
-
naeural_client/logging/base_logger.py,sha256=
|
61
|
+
naeural_client/logging/base_logger.py,sha256=sTdY0IudHyJKluKkJexyR4ZCZvO1XVKwKMjc1LeOL5E,67694
|
62
62
|
naeural_client/logging/small_logger.py,sha256=m12hCb_H4XifJYYfgCAOUDkcXm-h4pSODnFf277OFVI,2937
|
63
63
|
naeural_client/logging/logger_mixins/__init__.py,sha256=yQO7umlRvz63FeWpi-F9GRmC_MOHcNW6R6pwvZZBy3A,600
|
64
64
|
naeural_client/logging/logger_mixins/class_instance_mixin.py,sha256=xUXE2VZgmrlrSrvw0f6GF1jlTnVLeVkIiG0bhlBfq3o,2741
|
@@ -83,8 +83,8 @@ naeural_client/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_L
|
|
83
83
|
naeural_client/utils/config.py,sha256=Ub5sw3NG6wskAF5C4s0WU0rzXHVLy70ZTRU0W8HUGTM,6403
|
84
84
|
naeural_client/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
|
85
85
|
naeural_client/utils/oracle_sync/multiple_requests.py,sha256=GLzROGZ0gI4d1PVWgW_JBUYZjEL4LqZvHvwelxDiPW4,20892
|
86
|
-
naeural_client-2.6.
|
87
|
-
naeural_client-2.6.
|
88
|
-
naeural_client-2.6.
|
89
|
-
naeural_client-2.6.
|
90
|
-
naeural_client-2.6.
|
86
|
+
naeural_client-2.6.38.dist-info/METADATA,sha256=FMIZJz7rvigO89iYXnbLXy86Nyu0QzYUd1P-1EuvPDw,12354
|
87
|
+
naeural_client-2.6.38.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
88
|
+
naeural_client-2.6.38.dist-info/entry_points.txt,sha256=CTua17GUrRa4aXeafezGC9TiWKGKQzwTjQmB2jyj22g,91
|
89
|
+
naeural_client-2.6.38.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
|
90
|
+
naeural_client-2.6.38.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|