naeural-client 2.7.26__py3-none-any.whl → 2.7.28__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 CHANGED
@@ -1,4 +1,4 @@
1
- __VER__ = "2.7.26"
1
+ __VER__ = "2.7.28"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
naeural_client/bc/base.py CHANGED
@@ -1510,6 +1510,7 @@ class BaseBlockEngine:
1510
1510
  max_tries=5,
1511
1511
  network=None,
1512
1512
  return_full_data=False,
1513
+ debug_data=False,
1513
1514
  **kwargs
1514
1515
  ):
1515
1516
  """
@@ -1575,13 +1576,22 @@ class BaseBlockEngine:
1575
1576
  while not done:
1576
1577
  self.P(f"<{eth_short}> ({network}) dAuth with `{url}`... (try {tries + 1} / {max_tries})")
1577
1578
  try:
1578
- to_send = {
1579
- **kwargs,
1580
- DAUTH_NONCE : str(uuid.uuid4())[:8],
1581
- dAuth.DAUTH_SENDER_APP_VER : app_version,
1582
- dAuth.DAUTH_SENDER_SDK_VER : sdk_version,
1583
- dAuth.DAUTH_SENDER_CORE_VER : core_version,
1584
- }
1579
+ if debug_data:
1580
+ to_send = {
1581
+ DAUTH_NONCE : str(uuid.uuid4())[:8],
1582
+ dAuth.DAUTH_SENDER_APP_VER : app_version,
1583
+ dAuth.DAUTH_SENDER_SDK_VER : sdk_version,
1584
+ dAuth.DAUTH_SENDER_CORE_VER : core_version,
1585
+ **kwargs,
1586
+ }
1587
+ else:
1588
+ to_send = {
1589
+ **kwargs,
1590
+ DAUTH_NONCE : str(uuid.uuid4())[:8],
1591
+ dAuth.DAUTH_SENDER_APP_VER : app_version,
1592
+ dAuth.DAUTH_SENDER_SDK_VER : sdk_version,
1593
+ dAuth.DAUTH_SENDER_CORE_VER : core_version,
1594
+ }
1585
1595
  ######
1586
1596
  if len(kwargs) == 0:
1587
1597
  to_send[dAuth.DAUTH_SENDER_ALIAS] = dAuth.DAUTH_SENDER_ALIAS_DEFAULT
@@ -1648,8 +1648,7 @@ class BaseLogger(object):
1648
1648
  return result
1649
1649
 
1650
1650
 
1651
- @staticmethod
1652
- def utc_to_local(remote_datetime, remote_utc, fmt='%Y-%m-%d %H:%M:%S', as_string=False):
1651
+ def utc_to_local(self, remote_datetime, remote_utc, fmt='%Y-%m-%d %H:%M:%S', as_string=False):
1653
1652
  """
1654
1653
  Given a "remote" datetime (in datetime or str format) and a string or int denoting an offset
1655
1654
  will return local datetime as a datetime object.
@@ -1668,13 +1667,21 @@ class BaseLogger(object):
1668
1667
  """
1669
1668
  if remote_utc is None:
1670
1669
  remote_utc = 'UTC+3'
1671
- if isinstance(remote_utc, str):
1672
- remote_utc = tz.gettz(remote_utc)
1673
- elif isinstance(remote_utc, int):
1674
- utc_offset = remote_utc
1675
- remote_utc = tz.tzoffset(None, timedelta(hours=utc_offset))
1676
- elif not isinstance(remote_utc, tzinfo):
1677
- raise ValueError("Unknown remote_utc type: {}".format(type(remote_utc)))
1670
+ try:
1671
+ if isinstance(remote_utc, str):
1672
+ remote_utc = tz.gettz(remote_utc)
1673
+ elif isinstance(remote_utc, int):
1674
+ utc_offset = remote_utc
1675
+ remote_utc = tz.tzoffset(None, timedelta(hours=utc_offset))
1676
+ elif not isinstance(remote_utc, tzinfo):
1677
+ raise ValueError("Unknown remote_utc type: {}".format(type(remote_utc)))
1678
+ except Exception as exc:
1679
+ # if it breaks use local time
1680
+ remote_utc = tz.tzlocal()
1681
+ self.P("Error in remote_datetime: {} requested remote_utc: {}, Error: {}. Using local timezone {} for given date.".format(
1682
+ remote_datetime, remote_utc, exc, remote_utc), color='r'
1683
+ )
1684
+
1678
1685
 
1679
1686
  if isinstance(remote_datetime, str):
1680
1687
  remote_datetime = dt.strptime(remote_datetime, fmt)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naeural_client
3
- Version: 2.7.26
3
+ Version: 2.7.28
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=4aJFznz6iNPoG438iPfI7U7QS5QQHePWmnhay4adMFM,331
2
+ naeural_client/_ver.py,sha256=UldhiT7SDBMItRJw7teP6ZIocT6IlUPOV6sH-UQtQuU,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=-BXy-o3mP3Z6Qo2oc0DbWAuUdT3wQOGJbED9QtQ2KCE,46624
17
+ naeural_client/bc/base.py,sha256=ynaB1C18r7AmPrKgmvdt5cCqQhf6oS5tkkuulHI3B24,46986
18
18
  naeural_client/bc/chain.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  naeural_client/bc/ec.py,sha256=-HPfKpYAqy_eZpiJf3gWR2L4ZDDP7fZY2uwdNYYmS80,23868
20
20
  naeural_client/certs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -60,7 +60,7 @@ naeural_client/io_formatter/default/a_dummy.py,sha256=qr9eUizQ-NN5jdXVzkaZKMaf9K
60
60
  naeural_client/io_formatter/default/aixp1.py,sha256=MX0TeUR4APA-qN3vUC6uzcz8Pssz5lgrQWo7td5Ri1A,3052
61
61
  naeural_client/io_formatter/default/default.py,sha256=gEy78cP2D5s0y8vQh4aHuxqz7D10gGfuiKF311QhrpE,494
62
62
  naeural_client/logging/__init__.py,sha256=b79X45VC6c37u32flKB2GAK9f-RR0ocwP0JDCy0t7QQ,33
63
- naeural_client/logging/base_logger.py,sha256=YxTqqjWpA6GCG_HoKbibSxkMGhVfIxfSPANUDrszzp0,69292
63
+ naeural_client/logging/base_logger.py,sha256=c-ZSMHc_eO84MKrLOJcClxvhQydFD8W0LoWe5_hu2ag,69611
64
64
  naeural_client/logging/small_logger.py,sha256=m12hCb_H4XifJYYfgCAOUDkcXm-h4pSODnFf277OFVI,2937
65
65
  naeural_client/logging/logger_mixins/__init__.py,sha256=yQO7umlRvz63FeWpi-F9GRmC_MOHcNW6R6pwvZZBy3A,600
66
66
  naeural_client/logging/logger_mixins/class_instance_mixin.py,sha256=xUXE2VZgmrlrSrvw0f6GF1jlTnVLeVkIiG0bhlBfq3o,2741
@@ -85,8 +85,8 @@ naeural_client/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_L
85
85
  naeural_client/utils/config.py,sha256=IG7-rRYBWCqCiI2kDesFmY8gld0Ku9xWgzNPE1rwVcA,10352
86
86
  naeural_client/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
87
87
  naeural_client/utils/oracle_sync/oracle_tester.py,sha256=GmZwu2JM9_UB2K-4rKB3o0RgWLqM-7Im6HwBnQLXmHI,25312
88
- naeural_client-2.7.26.dist-info/METADATA,sha256=OXbhHwmcarRtknEk377dMK7-22QOBTWLRxiEQWm2-Dg,12354
89
- naeural_client-2.7.26.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
90
- naeural_client-2.7.26.dist-info/entry_points.txt,sha256=CTua17GUrRa4aXeafezGC9TiWKGKQzwTjQmB2jyj22g,91
91
- naeural_client-2.7.26.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
92
- naeural_client-2.7.26.dist-info/RECORD,,
88
+ naeural_client-2.7.28.dist-info/METADATA,sha256=Gng5HKyrSwkWOXATedt05ywnkUgtAbQn9eExCeyVtJo,12354
89
+ naeural_client-2.7.28.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
90
+ naeural_client-2.7.28.dist-info/entry_points.txt,sha256=CTua17GUrRa4aXeafezGC9TiWKGKQzwTjQmB2jyj22g,91
91
+ naeural_client-2.7.28.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
92
+ naeural_client-2.7.28.dist-info/RECORD,,