smallneuron 1.0.1__tar.gz → 1.0.2__tar.gz

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.
Files changed (29) hide show
  1. {smallneuron-1.0.1/src/smallneuron.egg-info → smallneuron-1.0.2}/PKG-INFO +1 -1
  2. {smallneuron-1.0.1 → smallneuron-1.0.2}/pyproject.toml +1 -1
  3. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/smallneuron.py +28 -26
  4. {smallneuron-1.0.1 → smallneuron-1.0.2/src/smallneuron.egg-info}/PKG-INFO +1 -1
  5. {smallneuron-1.0.1 → smallneuron-1.0.2}/.gitignore +0 -0
  6. {smallneuron-1.0.1 → smallneuron-1.0.2}/LICENSE +0 -0
  7. {smallneuron-1.0.1 → smallneuron-1.0.2}/README.md +0 -0
  8. {smallneuron-1.0.1 → smallneuron-1.0.2}/example.py +0 -0
  9. {smallneuron-1.0.1 → smallneuron-1.0.2}/setup.cfg +0 -0
  10. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/__init__.py +0 -0
  11. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/build +0 -0
  12. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/gpio_h3.c +0 -0
  13. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/gpio_h3.h +0 -0
  14. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/gpio_h3.so +0 -0
  15. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/logger.py +0 -0
  16. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/sndummy.py +0 -0
  17. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/sngpio.py +0 -0
  18. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/snhttp.py +0 -0
  19. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/sninput.py +0 -0
  20. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/snmqtt.py +0 -0
  21. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/snserial.py +0 -0
  22. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron/sntimer.py +0 -0
  23. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron.egg-info/SOURCES.txt +0 -0
  24. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron.egg-info/dependency_links.txt +0 -0
  25. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron.egg-info/top_level.txt +0 -0
  26. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron_pelainux.egg-info/PKG-INFO +0 -0
  27. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron_pelainux.egg-info/SOURCES.txt +0 -0
  28. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron_pelainux.egg-info/dependency_links.txt +0 -0
  29. {smallneuron-1.0.1 → smallneuron-1.0.2}/src/smallneuron_pelainux.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smallneuron
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Small Neuron Workflow
5
5
  Author-email: Andres Artigas <andres@artigas.cl>
6
6
  Project-URL: Homepage, https://github.com/pypa/sampleproject
@@ -3,7 +3,7 @@ requires = ["setuptools", "setuptools-scm"]
3
3
 
4
4
  [project]
5
5
  name = "smallneuron"
6
- version = "1.0.1"
6
+ version = "1.0.2"
7
7
  authors = [
8
8
  { name="Andres Artigas", email="andres@artigas.cl" },
9
9
  ]
@@ -309,9 +309,7 @@ class SnWatcher():
309
309
  except Exception as e:
310
310
  log.error(e)
311
311
  log.error(traceback.format_exc())
312
- self.em.putEvent("panic", str(e))
313
- exit(1)
314
-
312
+
315
313
  log.debug("SnWatcher.run done")
316
314
  return True
317
315
  log.debug("SnWatcher.run fail")
@@ -319,30 +317,34 @@ class SnWatcher():
319
317
 
320
318
  def _check(self, args):
321
319
  log.debug("SnWatcher._check loop start",args)
322
- [bridge,args,mode, period] = args
323
- while not self.stop:
324
- resp=bridge.check(**args)
325
-
326
- # Si la respuesta no es un dict
327
- # creamos uno con la respuesta como data
328
- if type(resp) != dict:
329
- data=resp
330
- resp={"data":data}
331
-
332
- if self.event_pattern == None or re.search(self.event_pattern, resp["data"]) != None:
333
- self.em.putEvent(self.event, dict(self.event_args,**resp))
334
- log.info("SnWatcher trigger", self.event_args)
335
- if mode=="match":
336
- log.debug("SnWatcher._check loop exit, match")
320
+ try:
321
+ [bridge,args,mode, period] = args
322
+ while not self.stop:
323
+ resp=bridge.check(**args)
324
+
325
+ # Si la respuesta no es un dict
326
+ # creamos uno con la respuesta como data
327
+ if type(resp) != dict:
328
+ data=resp
329
+ resp={"data":data}
330
+
331
+ if self.event_pattern == None or re.search(self.event_pattern, resp["data"]) != None:
332
+ self.em.putEvent(self.event, dict(self.event_args,**resp))
333
+ log.info("SnWatcher trigger", self.event_args)
334
+ if mode=="match":
335
+ log.debug("SnWatcher._check loop exit, match")
336
+ return
337
+
338
+ if mode=="noloop" :
339
+ log.debug("SnWatcher._check loop exit, noloop")
337
340
  return
338
-
339
- if mode=="noloop" :
340
- log.debug("SnWatcher._check loop exit, noloop")
341
- return
342
-
343
- # default mode is loop
344
- sleep(period)
345
- log.debug("SnWatcher._check loop exit, stop")
341
+
342
+ # default mode is loop
343
+ sleep(period)
344
+ log.debug("SnWatcher._check loop exit, stop")
345
+ except Exception as e:
346
+ log.error(e)
347
+ log.error(traceback.format_exc())
346
348
 
347
349
  def stop(self):
348
350
  self.stop=True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smallneuron
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Small Neuron Workflow
5
5
  Author-email: Andres Artigas <andres@artigas.cl>
6
6
  Project-URL: Homepage, https://github.com/pypa/sampleproject
File without changes
File without changes
File without changes
File without changes
File without changes