naeural-client 2.6.0__py3-none-any.whl → 2.6.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
naeural_client/_ver.py CHANGED
@@ -1,4 +1,4 @@
1
- __VER__ = "2.6.0"
1
+ __VER__ = "2.6.1"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
@@ -335,7 +335,7 @@ class BaseLogger(object):
335
335
  return False
336
336
 
337
337
  @staticmethod
338
- def replace_secrets(dct_config, pattern='$EE_'):
338
+ def replace_secrets(dct_config, pattern='$EE_', allow_missing=False):
339
339
  matches = []
340
340
  missing = []
341
341
  stack = [dct_config]
@@ -349,6 +349,8 @@ class BaseLogger(object):
349
349
  env_var_name = value[1:]
350
350
  if env_var_name not in os.environ:
351
351
  missing.append(env_var_name)
352
+ if allow_missing:
353
+ current[key] = None
352
354
  else:
353
355
  current[key] = os.environ[env_var_name]
354
356
  elif isinstance(value, (dict, list)):
@@ -358,9 +360,13 @@ class BaseLogger(object):
358
360
  if isinstance(item, (dict, list)):
359
361
  stack.append(item)
360
362
  if len(missing) > 0:
361
- raise ValueError('Required environment configuration for keys {} was not found in current envirnoment. Please setup your docker or bare-metal config to provide this missing key(s)'.format(
363
+ msg = 'Required environment configuration for keys {} was not found in current envirnoment. Please setup your docker or bare-metal config to provide this missing key(s)'.format(
362
364
  ",".join(['"' + x + '"' for x in missing])
363
- ))
365
+ )
366
+ if allow_missing:
367
+ BaseLogger.print_color(msg, color='r')
368
+ else:
369
+ raise ValueError(msg)
364
370
  return matches
365
371
 
366
372
 
@@ -1087,7 +1093,7 @@ class BaseLogger(object):
1087
1093
  **self.__init_config_data,
1088
1094
  }
1089
1095
 
1090
- matches = self.replace_secrets(self.config_data)
1096
+ matches = self.replace_secrets(self.config_data, allow_missing=True)
1091
1097
  if not self.silent:
1092
1098
  if len(matches) > 0:
1093
1099
  print(" Config modified with following env vars: {}".format(matches))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naeural_client
3
- Version: 2.6.0
3
+ Version: 2.6.1
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=8l5htl3vbgo8TfOaTMzZk4pKVa_lEaGc7XDdqAOdqCI,330
2
+ naeural_client/_ver.py,sha256=wxvGE0zwZeIkiIricsimOfmCLopTSbo_If_EzC5os7A,330
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
@@ -57,7 +57,7 @@ naeural_client/io_formatter/default/a_dummy.py,sha256=qr9eUizQ-NN5jdXVzkaZKMaf9K
57
57
  naeural_client/io_formatter/default/aixp1.py,sha256=MX0TeUR4APA-qN3vUC6uzcz8Pssz5lgrQWo7td5Ri1A,3052
58
58
  naeural_client/io_formatter/default/default.py,sha256=gEy78cP2D5s0y8vQh4aHuxqz7D10gGfuiKF311QhrpE,494
59
59
  naeural_client/logging/__init__.py,sha256=b79X45VC6c37u32flKB2GAK9f-RR0ocwP0JDCy0t7QQ,33
60
- naeural_client/logging/base_logger.py,sha256=himUkM_48-YXS4u0zJ_5jSd564PeXNpa8uttpgKkljA,66032
60
+ naeural_client/logging/base_logger.py,sha256=K3pFqtM8bjQ8w9LqKXbDZodh77ZO-stTW_wN5KVe14U,66242
61
61
  naeural_client/logging/small_logger.py,sha256=m12hCb_H4XifJYYfgCAOUDkcXm-h4pSODnFf277OFVI,2937
62
62
  naeural_client/logging/logger_mixins/__init__.py,sha256=yQO7umlRvz63FeWpi-F9GRmC_MOHcNW6R6pwvZZBy3A,600
63
63
  naeural_client/logging/logger_mixins/class_instance_mixin.py,sha256=xUXE2VZgmrlrSrvw0f6GF1jlTnVLeVkIiG0bhlBfq3o,2741
@@ -81,8 +81,8 @@ naeural_client/utils/__init__.py,sha256=mAnke3-MeRzz3nhQvhuHqLnpaaCSmDxicd7Ck9uw
81
81
  naeural_client/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,1072
82
82
  naeural_client/utils/config.py,sha256=JfW2gMQMYx9NzF2M4mJpioXawDHcOQ3deJprpCRtdOI,5874
83
83
  naeural_client/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
84
- naeural_client-2.6.0.dist-info/METADATA,sha256=BduegOU9wXWNr2DsNAurIRJjBgf2l4o6X12UmlOiipY,14618
85
- naeural_client-2.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
- naeural_client-2.6.0.dist-info/entry_points.txt,sha256=PNdyotDaQBAslZREx5luVyj0kqpQnwNACwkFNTPIHU4,55
87
- naeural_client-2.6.0.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
88
- naeural_client-2.6.0.dist-info/RECORD,,
84
+ naeural_client-2.6.1.dist-info/METADATA,sha256=5K50wytOF7_Wa3xjBuIy0YE7Dpxs-gmVGutEQT4-erE,14618
85
+ naeural_client-2.6.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
+ naeural_client-2.6.1.dist-info/entry_points.txt,sha256=PNdyotDaQBAslZREx5luVyj0kqpQnwNACwkFNTPIHU4,55
87
+ naeural_client-2.6.1.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
88
+ naeural_client-2.6.1.dist-info/RECORD,,