smallneuron 2.4.9__tar.gz → 2.4.12__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 (30) hide show
  1. {smallneuron-2.4.9/src/smallneuron.egg-info → smallneuron-2.4.12}/PKG-INFO +4 -3
  2. smallneuron-2.4.12/pyproject.toml +25 -0
  3. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/logger.py +2 -0
  4. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/smallneuron.py +33 -33
  5. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/snwatcher.py +4 -3
  6. {smallneuron-2.4.9 → smallneuron-2.4.12/src/smallneuron.egg-info}/PKG-INFO +4 -3
  7. smallneuron-2.4.9/pyproject.toml +0 -27
  8. {smallneuron-2.4.9 → smallneuron-2.4.12}/.gitignore +0 -0
  9. {smallneuron-2.4.9 → smallneuron-2.4.12}/LICENSE +0 -0
  10. {smallneuron-2.4.9 → smallneuron-2.4.12}/README.md +0 -0
  11. {smallneuron-2.4.9 → smallneuron-2.4.12}/example.py +0 -0
  12. {smallneuron-2.4.9 → smallneuron-2.4.12}/setup.cfg +0 -0
  13. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/__init__.py +0 -0
  14. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/build +0 -0
  15. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/gpio_h3.c +0 -0
  16. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/gpio_h3.h +0 -0
  17. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/gpio_h3.so +0 -0
  18. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/sndummy.py +0 -0
  19. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/sngpio.py +0 -0
  20. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/sninput.py +0 -0
  21. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/snmqtt.py +0 -0
  22. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/snserial.py +0 -0
  23. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron/sntimer.py +0 -0
  24. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron.egg-info/SOURCES.txt +0 -0
  25. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron.egg-info/dependency_links.txt +0 -0
  26. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron.egg-info/top_level.txt +0 -0
  27. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron_pelainux.egg-info/PKG-INFO +0 -0
  28. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron_pelainux.egg-info/SOURCES.txt +0 -0
  29. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron_pelainux.egg-info/dependency_links.txt +0 -0
  30. {smallneuron-2.4.9 → smallneuron-2.4.12}/src/smallneuron_pelainux.egg-info/top_level.txt +0 -0
@@ -1,16 +1,17 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: smallneuron
3
- Version: 2.4.9
3
+ Version: 2.4.12
4
4
  Summary: Small Neuron Workflow
5
5
  Author-email: Andres Artigas <andres@artigas.cl>
6
+ License-Expression: MIT
6
7
  Project-URL: Homepage, https://github.com/pypa/sampleproject
7
8
  Project-URL: Issues, https://github.com/pypa/sampleproject/issues
8
9
  Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.7
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
+ Dynamic: license-file
14
15
 
15
16
  # smallneuron
16
17
  Network Programming platform
@@ -0,0 +1,25 @@
1
+ [build-system]
2
+ requires = [ "setuptools",]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "smallneuron"
7
+ version = "2.4.12"
8
+ license = "MIT"
9
+ description = "Small Neuron Workflow"
10
+ readme = "README.md"
11
+ requires-python = ">=3.7"
12
+ classifiers = [ "Programming Language :: Python :: 3", "Operating System :: OS Independent",]
13
+ [[project.authors]]
14
+ name = "Andres Artigas"
15
+ email = "andres@artigas.cl"
16
+
17
+ [project.urls]
18
+ Homepage = "https://github.com/pypa/sampleproject"
19
+ Issues = "https://github.com/pypa/sampleproject/issues"
20
+
21
+ [tool.setuptools.package-data]
22
+ smallneuron = [ "*.c", "*.h", "build",]
23
+
24
+ [tool.setuptools.packages.find]
25
+ where = [ "src",]
@@ -84,6 +84,8 @@ class Logger:
84
84
  msg = msg + " " + str(a)
85
85
 
86
86
  syslog.syslog(severity, msg)
87
+ if syslog.LOG_ERR >= severity:
88
+ print(msg)
87
89
  syslog.closelog()
88
90
  except Exception as e:
89
91
  print("Syslog fail ", e)
@@ -294,44 +294,44 @@ class EventManager:
294
294
  validUntil = eventTuple[2] # valid Until
295
295
 
296
296
  log.perfMark(f"[%d] start event %s"%(self.count,event))
297
- log.notice("[",self.count,"] Event:", event, params)
298
297
 
299
298
 
300
299
  if validUntil != 0 and validUntil < self.count:
301
- log.warn("[",self.count,"] ", event, " is caduced ", validUntil, "<", self.count)
302
-
303
- elif event in self.net:
304
- log.perfMark(f" event in net")
305
- if not self.currentState in self.net[event]:
306
- log.warn("[",self.count,"] ", event, " not valid for state ", self.currentState, "discarted!")
307
- else:
308
- node_to: Node = self.net[event][self.currentState][0]
309
-
310
- # indicamos al nodo actual que salimos
311
- log.info("[",self.count,"] leave ", self.currentNode.state)
312
- self.currentNode.leave(event,params,node_to.state)
313
-
314
- # Entramos al nodo nuevo
315
- original_params=copy.deepcopy(params) # por si enter los modifica y reportar lo que llego
316
- log.info("[",self.count,"] enter ", node_to.state, params)
317
- node_to.enter(event, params, self.currentState)
318
-
319
- # Cambiamos de estado
320
- self.change_state(event, original_params, node_to)
300
+ log.notice("[",self.count,"] Caduced:", event, " ", validUntil, "<", self.count)
301
+ else:
302
+ log.notice("[",self.count,"] Event:", event, params)
303
+ if event in self.net:
304
+ log.perfMark(f" event in net")
305
+ if not self.currentState in self.net[event]:
306
+ log.warn("[",self.count,"] ", event, " not valid for state ", self.currentState, "discarted!")
307
+ else:
308
+ node_to: Node = self.net[event][self.currentState][0]
309
+
310
+ # indicamos al nodo actual que salimos
311
+ log.info("[",self.count,"] leave ", self.currentNode.state)
312
+ self.currentNode.leave(event,params,node_to.state)
313
+
314
+ # Entramos al nodo nuevo
315
+ original_params=copy.deepcopy(params) # por si enter los modifica y reportar lo que llego
316
+ log.info("[",self.count,"] enter ", node_to.state, params)
317
+ node_to.enter(event, params, self.currentState)
318
+
319
+ # Cambiamos de estado
320
+ self.change_state(event, original_params, node_to)
321
+ self.printGraph(event)
322
+ elif event in self.cmds:
323
+ log.info("[", self.count, "] Manager new cmd ", event)
324
+ node_to: Node = self.cmds[event][0]
325
+ log.perfMark(f" enter cmd")
326
+ if node_to.change_state:
327
+ self.currentNode.leave(event,params,node_to.state)
328
+ node_to.enter(event, params, self.currentState)
329
+ self.change_state(event, params, node_to)
330
+ else:
331
+ node_to.enter(event, params, self.currentState)
321
332
  self.printGraph(event)
322
- elif event in self.cmds:
323
- log.info("[", self.count, "] Manager new cmd ", event)
324
- node_to: Node = self.cmds[event][0]
325
- log.perfMark(f" enter cmd")
326
- if node_to.change_state:
327
- self.currentNode.leave(event,params,node_to.state)
328
- node_to.enter(event, params, self.currentState)
329
- self.change_state(event, params, node_to)
330
333
  else:
331
- node_to.enter(event, params, self.currentState)
332
- self.printGraph(event)
333
- else:
334
- log.warn("[",self.count,"] ", event, " not exist")
334
+ log.warn("[",self.count,"] ", event, " not exist")
335
335
  except Exception as e:
336
336
  log.error(e)
337
337
  log.error(traceback.format_exc())
@@ -54,9 +54,10 @@ class SnWatcher():
54
54
  return False
55
55
 
56
56
  def _loop_callback(self, args):
57
- log.debug( " _loop_callback start, tid ",threading.get_native_id(), args)
58
57
  try:
59
58
  [callback_obj,callback_function_args,mode, period] = args
59
+
60
+ log.debug( "Watcher START, tid ",threading.get_native_id(), [callback_obj.__class__.__name__, callback_function_args, mode,period])
60
61
  # Pasamos como argumento a la funcion externa un diccionario para los datos
61
62
  # que necesite persistir entre llamados
62
63
  while not self.stoploop:
@@ -89,11 +90,11 @@ class SnWatcher():
89
90
  # default mode is loop
90
91
  sleep(period)
91
92
 
92
- log.debug(threading.get_ident(),"_check loop exit, stop")
93
+ log.debug( "Watcher END, tid ",threading.get_native_id(), [callback_obj.__class__.__name__, callback_function_args, mode,period])
93
94
  except Exception as e:
94
95
  log.error(e)
95
96
  log.error(traceback.format_exc())
96
- log.debug(threading.get_ident(),f"_check loop exit, exception for event {self.event}")
97
+ log.debug( "Watcher FAIL, tid ",threading.get_native_id(),f"_check loop exit, exception for event {self.event}")
97
98
 
98
99
 
99
100
  def stop(self, wait_to_finish=False):
@@ -1,16 +1,17 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: smallneuron
3
- Version: 2.4.9
3
+ Version: 2.4.12
4
4
  Summary: Small Neuron Workflow
5
5
  Author-email: Andres Artigas <andres@artigas.cl>
6
+ License-Expression: MIT
6
7
  Project-URL: Homepage, https://github.com/pypa/sampleproject
7
8
  Project-URL: Issues, https://github.com/pypa/sampleproject/issues
8
9
  Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.7
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
+ Dynamic: license-file
14
15
 
15
16
  # smallneuron
16
17
  Network Programming platform
@@ -1,27 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools", "setuptools-scm"]
3
-
4
- [project]
5
- name = "smallneuron"
6
- version = "2.4.9"
7
- authors = [
8
- { name="Andres Artigas", email="andres@artigas.cl" },
9
- ]
10
- description = "Small Neuron Workflow"
11
- readme = "README.md"
12
- requires-python = ">=3.7"
13
- classifiers = [
14
- "Programming Language :: Python :: 3",
15
- "License :: OSI Approved :: MIT License",
16
- "Operating System :: OS Independent",
17
- ]
18
-
19
- [tool.setuptools.packages.find]
20
- where = ["src"]
21
-
22
- [tool.setuptools.package-data]
23
- smallneuron = ["*.c", "*.h", "build"]
24
-
25
- [project.urls]
26
- Homepage = "https://github.com/pypa/sampleproject"
27
- Issues = "https://github.com/pypa/sampleproject/issues"
File without changes
File without changes
File without changes
File without changes
File without changes