p3lib 1.1.95__tar.gz → 1.1.97__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 (31) hide show
  1. {p3lib-1.1.95 → p3lib-1.1.97}/PKG-INFO +1 -1
  2. {p3lib-1.1.95 → p3lib-1.1.97}/setup.cfg +1 -1
  3. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/boot_manager.py +30 -26
  4. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib.egg-info/PKG-INFO +1 -1
  5. {p3lib-1.1.95 → p3lib-1.1.97}/LICENSE +0 -0
  6. {p3lib-1.1.95 → p3lib-1.1.97}/README.md +0 -0
  7. {p3lib-1.1.95 → p3lib-1.1.97}/pyproject.toml +0 -0
  8. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/__init__.py +0 -0
  9. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/ate.py +0 -0
  10. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/bokeh_auth.py +0 -0
  11. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/bokeh_gui.py +0 -0
  12. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/conduit.py +0 -0
  13. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/database_if.py +0 -0
  14. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/helper.py +0 -0
  15. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/json_networking.py +0 -0
  16. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/mqtt_rpc.py +0 -0
  17. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/netif.py +0 -0
  18. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/netplotly.py +0 -0
  19. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/ngt.py +0 -0
  20. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/pconfig.py +0 -0
  21. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/ssh.py +0 -0
  22. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/table_plot.py +0 -0
  23. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib/uio.py +0 -0
  24. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib.egg-info/SOURCES.txt +0 -0
  25. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib.egg-info/dependency_links.txt +0 -0
  26. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib.egg-info/requires.txt +0 -0
  27. {p3lib-1.1.95 → p3lib-1.1.97}/src/p3lib.egg-info/top_level.txt +0 -0
  28. {p3lib-1.1.95 → p3lib-1.1.97}/tests/test_conduit.py +0 -0
  29. {p3lib-1.1.95 → p3lib-1.1.97}/tests/test_json_networking.py +0 -0
  30. {p3lib-1.1.95 → p3lib-1.1.97}/tests/test_netif.py +0 -0
  31. {p3lib-1.1.95 → p3lib-1.1.97}/tests/test_ssh.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p3lib
3
- Version: 1.1.95
3
+ Version: 1.1.97
4
4
  Summary: A group of python modules for networking, plotting data, config storage, automating boot scripts, ssh access and user input output.
5
5
  Home-page: https://github.com/pjaos/p3lib
6
6
  Author: Paul Austen
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = p3lib
3
- version = 1.1.95
3
+ version = 1.1.97
4
4
  author = Paul Austen
5
5
  author_email = pausten.os@gmail.com
6
6
  description = A group of python modules for networking, plotting data, config storage, automating boot scripts, ssh access and user input output.
@@ -40,7 +40,7 @@ class BootManager(object):
40
40
  @return True if handled , False if not."""
41
41
  handled = False
42
42
  if options.check_auto_start:
43
- BootManager.CheckAutoStartStatus(uio)
43
+ BootManager.CheckAutoStartStatus(uio, appName)
44
44
  handled = True
45
45
 
46
46
  elif options.enable_auto_start:
@@ -48,7 +48,7 @@ class BootManager(object):
48
48
  handled = True
49
49
 
50
50
  elif options.disable_auto_start:
51
- BootManager.DisableAutoStart(uio)
51
+ BootManager.DisableAutoStart(uio, appName)
52
52
  handled = True
53
53
 
54
54
  return handled
@@ -68,15 +68,21 @@ class BootManager(object):
68
68
  bootManager.add(argString=arsString, enableSyslog=enable_syslog)
69
69
 
70
70
  @staticmethod
71
- def DisableAutoStart(uio):
72
- """@brief Enable this program to auto start when the computer on which it is installed starts."""
73
- bootManager = BootManager(uio=uio, ensureRootUser=True)
71
+ def DisableAutoStart(uio, appName):
72
+ """@brief Enable this program to auto start when the computer on which it is installed starts.
73
+ @param uio A UIO instance.
74
+ @param appName The name of the app. This is used as the service name. If not set then
75
+ the name of the initially executed python file is used."""
76
+ bootManager = BootManager(uio=uio, ensureRootUser=True, appName=appName)
74
77
  bootManager.remove()
75
78
 
76
79
  @staticmethod
77
- def CheckAutoStartStatus(uio):
78
- """@brief Check the status of a process previously set to auto start."""
79
- bootManager = BootManager(uio=uio)
80
+ def CheckAutoStartStatus(uio, appName):
81
+ """@brief Check the status of a process previously set to auto start.
82
+ @param uio A UIO instance.
83
+ @param appName The name of the app. This is used as the service name. If not set then
84
+ the name of the initially executed python file is used."""
85
+ bootManager = BootManager(uio=uio, appName=appName)
80
86
  lines = bootManager.getStatus()
81
87
  if lines and len(lines) > 0:
82
88
  for line in lines:
@@ -269,25 +275,18 @@ class LinuxBootManager(object):
269
275
  if not os.path.isdir(exePath):
270
276
  self._fatalError("{} path not found".format(exePath))
271
277
 
272
- # If the appName was set in the constructor then use this.
273
- if self._appName:
274
- appName = self._appName
275
-
276
- # Else we use the initially executed python file.
277
- else:
278
-
279
- appName = os.path.basename(exeFile)
280
- if len(appName) == 0:
281
- self._fatalError("No app found to execute.")
278
+ appName = os.path.basename(exeFile)
279
+ if len(appName) == 0:
280
+ self._fatalError("No app found to execute.")
282
281
 
283
- absApp = os.path.join(exePath, appName)
284
- if not os.path.isfile( absApp ):
285
- self._fatalError("{} file not found.".format(absApp) )
282
+ absApp = os.path.join(exePath, appName)
283
+ if not os.path.isfile( absApp ):
284
+ self._fatalError("{} file not found.".format(absApp) )
286
285
 
287
- appName = appName.replace(".py", "")
288
- if self._rootMode:
289
- # We can only save to /var/log/ is we are root user.
290
- self._logFile = os.path.join(LinuxBootManager.LOG_PATH, appName)
286
+ appName = appName.replace(".py", "")
287
+ if self._rootMode:
288
+ # We can only save to /var/log/ is we are root user.
289
+ self._logFile = os.path.join(LinuxBootManager.LOG_PATH, appName)
291
290
 
292
291
  return (appName, absApp)
293
292
 
@@ -316,7 +315,12 @@ class LinuxBootManager(object):
316
315
 
317
316
  appName, absApp = self._getApp()
318
317
 
319
- serviceFile = self._getServiceFile(appName)
318
+ if self._appName:
319
+ serviceName = self._appName
320
+ else:
321
+ serviceName = appName
322
+
323
+ serviceFile = self._getServiceFile(serviceName)
320
324
 
321
325
  lines = []
322
326
  lines.append("[Unit]")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p3lib
3
- Version: 1.1.95
3
+ Version: 1.1.97
4
4
  Summary: A group of python modules for networking, plotting data, config storage, automating boot scripts, ssh access and user input output.
5
5
  Home-page: https://github.com/pjaos/p3lib
6
6
  Author: Paul Austen
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes