p3lib 1.1.78__py3-none-any.whl → 1.1.80__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.
p3lib/bokeh_auth.py CHANGED
@@ -321,9 +321,9 @@ class CredentialsManager(object):
321
321
  username = self._uio.getInput('Enter the username: ')
322
322
  password = self._uio.getInput('Enter the password: ')
323
323
  if self.credentialsHasher.verify(username, password):
324
- self._uio.info(f"The username and password match.")
324
+ self._uio.info("The username and password match.")
325
325
  else:
326
- self._uio.error(f"The username and password do not match.")
326
+ self._uio.error("The username and password do not match.")
327
327
 
328
328
  def _showUsernames(self):
329
329
  """@brief Show the user a list of the usernames stored."""
p3lib/boot_manager.py CHANGED
@@ -15,24 +15,22 @@ class BootManager(object):
15
15
 
16
16
  LINUX_OS_NAME = "Linux"
17
17
 
18
- def __init__(self, uio=None, allowRootUser=False):
18
+ def __init__(self, uio=None, allowRootUser=True, ensureRootUser=False):
19
19
  """@brief Constructor
20
20
  @param uio A UIO instance to display user output. If unset then no output
21
21
  is displayed to user.
22
22
  @param allowRootUser If True then allow root user to to auto start
23
- programs. We do not do this by default because often a programs
24
- configuration is stored in the users home path. E.G a config
25
- file in ~/.<configfilename> or ~/.config/<configfolder or filename>.
26
- If a program is started as root user then this config may not
27
- be present in the /root folder and so when the program is started
28
- it's config will not be found. If a program stores no config in
29
- the home folder then this is not an issue."""
23
+ programs. Note that as the BootManager is responsible for
24
+ ensuring programs are started up when a machine boots up
25
+ the installed program should be installed for the root
26
+ user on Linux systems.
27
+ @param ensureRootUser If True the current user must be root user (Linux systems)."""
30
28
  self._uio = uio
31
29
  self._allowRootUser=allowRootUser
32
30
  self._osName = platform.system()
33
31
  self._platformBootManager = None
34
32
  if self._osName == BootManager.LINUX_OS_NAME:
35
- self._platformBootManager = LinuxBootManager(uio, self._allowRootUser)
33
+ self._platformBootManager = LinuxBootManager(uio, self._allowRootUser, ensureRootUser)
36
34
  else:
37
35
  raise Exception("{} is an unsupported OS.".format(self._osName) )
38
36
 
@@ -100,16 +98,20 @@ class LinuxBootManager(object):
100
98
  raise Exception(f"{serviceFolder} folder not found.")
101
99
  return serviceFolder
102
100
 
103
- def __init__(self, uio, allowRootUser):
101
+ def __init__(self, uio, allowRootUser, ensureRootUser):
104
102
  """@brief Constructor
105
103
  @param uio A UIO instance to display user output. If unset then no output is displayed to user.
106
- @param allowRootUser If True then allow root user to to auto start programs."""
104
+ @param allowRootUser If True then allow root user to to auto start programs.
105
+ @param ensureRootUser If True the current user must be root user."""
107
106
  self._uio = uio
108
107
  self._logFile = None
109
108
  self._allowRootUser=allowRootUser
110
109
  self._info("OS: {}".format(platform.system()) )
111
110
  self._rootMode = False # If True run as root, else False.
112
111
  self._systemCtlBin = LinuxBootManager.GetSystemCTLBin()
112
+ if ensureRootUser and os.geteuid() != 0:
113
+ self._fatalError(self.__class__.__name__ + ": Not root user. Ensure that you are root user and try again.")
114
+
113
115
  if os.geteuid() == 0:
114
116
  if not allowRootUser:
115
117
  self._fatalError(self.__class__.__name__ + f": You are running as root user but allowRootUser={allowRootUser}.")
p3lib/table_plot.py CHANGED
@@ -18,7 +18,6 @@ from bokeh.layouts import gridplot, row, column
18
18
  from bokeh.plotting import figure, ColumnDataSource
19
19
  from bokeh.palettes import Category20
20
20
  from bokeh.models import HoverTool, Div
21
- from bokeh.models import DatetimeTickFormatter
22
21
  from bokeh.models.widgets.buttons import Button
23
22
  from bokeh.models.widgets import TextInput
24
23
  from bokeh.plotting import output_file, save
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p3lib
3
- Version: 1.1.78
3
+ Version: 1.1.80
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,8 +1,8 @@
1
1
  p3lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  p3lib/ate.py,sha256=_BiqMUYNAlp4O8MkP_PAUe62Bzd8dzV4Ipv62OFS6Ok,4759
3
- p3lib/bokeh_auth.py,sha256=XqdCLOalHL3dkyrMPqQoVQBSziVnqlfjB9YAWhZUd_U,14769
3
+ p3lib/bokeh_auth.py,sha256=wQKSiF_gYvCs5aWUptiDkloC2tmEO-5XiAQ0mO8KFYk,14767
4
4
  p3lib/bokeh_gui.py,sha256=55sajP_x9O1lE0uP3w3-T5f2oMzk7jSolLqxlEdLeLg,40245
5
- p3lib/boot_manager.py,sha256=5QRKnSfYLJG46u7CZBTamQSMknxv3IpMju2a8zuCK6o,14862
5
+ p3lib/boot_manager.py,sha256=IrIJg9LOsxWBP1-1wNR_mO_jzR1FAWVOBVtw7mHHLgw,14968
6
6
  p3lib/conduit.py,sha256=jPkjdtyCx2I6SFqcEo8y2g7rgnZ-jNY7oCuYIETzT5Q,6046
7
7
  p3lib/database_if.py,sha256=XKu1w3zftGbj4Rh54wrWJnoCtqHkhCzJUPN2S70XIKg,11915
8
8
  p3lib/helper.py,sha256=-B63_ncfchMwXrvyVcnj9sxwGnMJ3ASmLmpoYa4tBmM,11862
@@ -13,10 +13,10 @@ p3lib/netplotly.py,sha256=PMDx-w1jtRVW6Od5u_kuKbBxNpTS_Y88mMF60puMxLM,9363
13
13
  p3lib/ngt.py,sha256=rXA-6zQkfeOupZ-3Q-k3-1DvbKYIi2TCtLKgUb0waWY,37726
14
14
  p3lib/pconfig.py,sha256=_ri9w3aauHXZp8u2YLYHBVroFR_iCqaTCwj_MRa3rHo,30153
15
15
  p3lib/ssh.py,sha256=klqQ9YuqU8GwPVPHrAJeEs5PI5hgoYiXflq2kIGG3as,39509
16
- p3lib/table_plot.py,sha256=dRPZ9rFpwE9Dpyqrvbm5t2spVaPSHrx_B7KvfWVND3g,32166
16
+ p3lib/table_plot.py,sha256=RPncwVlGUkkx5Fw0dHQedXo0TSPlTi__VrJBDzaMsuI,32116
17
17
  p3lib/uio.py,sha256=hMarPnYXnqVF23HUIeDfzREo7TMdBjrupXMY_ffuCbI,23133
18
- p3lib-1.1.78.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
19
- p3lib-1.1.78.dist-info/METADATA,sha256=ICbyy5aewX_PXmUJLJeYKwtli9r8sCSlmD4pLPVjUIY,918
20
- p3lib-1.1.78.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
21
- p3lib-1.1.78.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
22
- p3lib-1.1.78.dist-info/RECORD,,
18
+ p3lib-1.1.80.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
19
+ p3lib-1.1.80.dist-info/METADATA,sha256=mWNK7BKcx26J9B9-OGr8zyc3fr0qZ2Pe7TFNyDb7LQw,918
20
+ p3lib-1.1.80.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
21
+ p3lib-1.1.80.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
22
+ p3lib-1.1.80.dist-info/RECORD,,
File without changes