p3lib 1.1.70__py3-none-any.whl → 1.1.72__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/ssh.py CHANGED
@@ -122,6 +122,7 @@ class SSH(object):
122
122
  PRIVATE_KEY_FILE_LIST = ["id_rsa", "id_dsa", 'id_ecdsa']
123
123
  PUBLIC_KEY_FILE_LIST = ["id_rsa.pub", "id_dsa.pub", 'id_ecdsa.pub']
124
124
  LOCAL_SSH_CONFIG_PATH = os.path.join(os.path.expanduser("~"), ".ssh")
125
+ DEFAULT_REMOTE_SSH_CONFIG_FOLDER = "~/.ssh"
125
126
  DEFAULT_REMOTE_SSH_AUTH_KEYS_FILE = "~/.ssh/authorized_keys"
126
127
  DROPBEAR_DIR = "/etc/dropbear"
127
128
  DROPBEAR_AUTH_KEYS_FILE = "%s/authorized_keys" % (DROPBEAR_DIR)
@@ -520,8 +521,17 @@ class SSH(object):
520
521
 
521
522
  cmd = "test -d %s" % (SSH.DROPBEAR_DIR)
522
523
  rc, stdoutLines, stderrLines = self.runCmd(cmd, throwError=False)
524
+ # If the ssh server uses dropbear
523
525
  if rc == 0:
524
526
  authKeysFile = SSH.DROPBEAR_AUTH_KEYS_FILE
527
+ else:
528
+ # Check for the users ssh config folder
529
+ cmd = "test -d %s" % (SSH.DEFAULT_REMOTE_SSH_CONFIG_FOLDER)
530
+ rc, stdoutLines, stderrLines = self.runCmd(cmd, throwError=False)
531
+ if rc != 0:
532
+ # If the remote ssh config folder does not exist, create it
533
+ cmd = f"mkdir {SSH.DEFAULT_REMOTE_SSH_CONFIG_FOLDER}"
534
+ rc, stdoutLines, stderrLines = self.runCmd(cmd, throwError=True)
525
535
 
526
536
  return authKeysFile
527
537
 
p3lib/table_plot.py CHANGED
@@ -131,7 +131,7 @@ class Table2DPlotServer(object):
131
131
  else:
132
132
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.WINDOW_TTLE} must be > 0 and <= 250 characters in length: {wTitle}"}
133
133
 
134
- if Table2DPlotServer.XAXIS_TYPE in rxDict:
134
+ elif Table2DPlotServer.XAXIS_TYPE in rxDict:
135
135
  xAxisType = rxDict[Table2DPlotServer.XAXIS_TYPE]
136
136
  if xAxisType in Table2DPlotServer.VALID_X_AXIS_TYPES:
137
137
  self.server.parent.staticPlotParams.xAxisType = xAxisType
@@ -139,70 +139,70 @@ class Table2DPlotServer(object):
139
139
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.XAXIS_TYPE} invalid: {xAxisType}"}
140
140
 
141
141
 
142
- if Table2DPlotServer.PLOT_PANEL_HEIGHT in rxDict:
142
+ elif Table2DPlotServer.PLOT_PANEL_HEIGHT in rxDict:
143
143
  pHeight = rxDict[Table2DPlotServer.PLOT_PANEL_HEIGHT]
144
144
  if pHeight > 10 and pHeight < 2048:
145
145
  self.server.parent.staticPlotParams.plotPanelHeight = pHeight
146
146
  else:
147
147
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.PLOT_PANEL_HEIGHT} invalid: {pHeight} must be > 10 and < 2048"}
148
148
 
149
- if Table2DPlotServer.LINE_PLOT in rxDict:
149
+ elif Table2DPlotServer.LINE_PLOT in rxDict:
150
150
  lPlot = rxDict[Table2DPlotServer.LINE_PLOT]
151
151
  if lPlot in (True, False):
152
152
  self.server.parent.staticPlotParams.linePlot = lPlot
153
153
  else:
154
154
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.LINE_PLOT} invalid, must be True of False not {lPlot}"}
155
155
 
156
- if Table2DPlotServer.PLOT_LINE_WIDTH in rxDict:
156
+ elif Table2DPlotServer.PLOT_LINE_WIDTH in rxDict:
157
157
  plWidth = rxDict[Table2DPlotServer.PLOT_LINE_WIDTH]
158
158
  if plWidth > 0 and plWidth < 100:
159
159
  self.server.parent.staticPlotParams.plotLineWidth = plWidth
160
160
  else:
161
161
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.PLOT_LINE_WIDTH} invalid, must be > 0 and < 100 not {plWidth}"}
162
162
 
163
- if Table2DPlotServer.SCATTER_PLOT_DOT_SIZE in rxDict:
163
+ elif Table2DPlotServer.SCATTER_PLOT_DOT_SIZE in rxDict:
164
164
  spDotSize = rxDict[Table2DPlotServer.SCATTER_PLOT_DOT_SIZE]
165
165
  if spDotSize > 0 and spDotSize < 250:
166
166
  self.server.parent.staticPlotParams.scatterPlotDotSize = spDotSize
167
167
  else:
168
168
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.SCATTER_PLOT_DOT_SIZE} invalid, must be > 0 and < 250 not {spDotSize}"}
169
169
 
170
- if Table2DPlotServer.THEME in rxDict:
170
+ elif Table2DPlotServer.THEME in rxDict:
171
171
  theme = rxDict[Table2DPlotServer.THEME]
172
172
  if theme in Table2DPlotServer.VALID_THEMES:
173
173
  self.server.parent.staticPlotParams.theme = theme
174
174
  else:
175
175
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.XAXIS_TYPE} invalid: {theme}"}
176
176
 
177
- if Table2DPlotServer.X_AXIS_NAME in rxDict:
177
+ elif Table2DPlotServer.X_AXIS_NAME in rxDict:
178
178
  xAxisName = rxDict[Table2DPlotServer.X_AXIS_NAME]
179
179
  if isinstance(xAxisName,str) and len(xAxisName) > 0 and len(xAxisName) <= 150:
180
180
  self.server.parent.staticPlotParams.xAxisName = xAxisName
181
181
  else:
182
182
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.X_AXIS_NAME} must be > 0 and <= 150 characters in length: {xAxisName}"}
183
183
 
184
- if Table2DPlotServer.HTML_FILE in rxDict:
184
+ elif Table2DPlotServer.HTML_FILE in rxDict:
185
185
  htmlFile = rxDict[Table2DPlotServer.HTML_FILE]
186
186
  if isinstance(htmlFile,str) and len(htmlFile) > 0 and len(htmlFile) <= 250:
187
187
  self.server.parent.staticPlotParams.htmlFile = htmlFile
188
188
  else:
189
189
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.HTML_FILE} must be > 0 and <= 250 characters in length: {htmlFile}"}
190
190
 
191
- if Table2DPlotServer.DISABLE_RESULT in rxDict:
191
+ elif Table2DPlotServer.DISABLE_RESULT in rxDict:
192
192
  disableResult = rxDict[Table2DPlotServer.DISABLE_RESULT]
193
193
  if disableResult in (True, False):
194
194
  self.server.parent.staticPlotParams.disableResult = disableResult
195
195
  else:
196
196
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.DISABLE_RESULT} invalid, must be True of False not {disableResult}"}
197
197
 
198
- if Table2DPlotServer.RESULT_WIDTH in rxDict:
198
+ elif Table2DPlotServer.RESULT_WIDTH in rxDict:
199
199
  resultWidth = rxDict[Table2DPlotServer.RESULT_WIDTH]
200
200
  if resultWidth > 10 and resultWidth < 2048:
201
201
  self.server.parent.staticPlotParams.resultWidth = resultWidth
202
202
  else:
203
203
  errorDict = {Table2DPlotServer.ERROR: f"{Table2DPlotServer.RESULT_WIDTH} invalid: {resultWidth} must be > 10 and < 2048"}
204
204
 
205
- if Table2DPlotServer.RESULT_TITLE in rxDict:
205
+ elif Table2DPlotServer.RESULT_TITLE in rxDict:
206
206
  resultTitle = rxDict[Table2DPlotServer.RESULT_TITLE]
207
207
  if isinstance(resultTitle,str) and len(resultTitle) > 0 and len(resultTitle) <= 250:
208
208
  self.server.parent.staticPlotParams.resultTitle = resultTitle
@@ -211,14 +211,14 @@ class Table2DPlotServer(object):
211
211
 
212
212
  # Set static parameters stop
213
213
 
214
- if Table2DPlotServer.SET_RESULT in rxDict:
214
+ elif Table2DPlotServer.SET_RESULT in rxDict:
215
215
  guiMsg = GUIMessage()
216
216
  guiMsg.type = GUIMessage.RESULT_DATA_TYPE
217
217
  guiMsg.data = rxDict[Table2DPlotServer.SET_RESULT]
218
218
  if self.server.parent._bokeh2DTablePlotter:
219
219
  self.server.parent._bokeh2DTablePlotter.sendMessage(guiMsg)
220
220
 
221
- if Table2DPlotServer.TABLE_COLUMNS in rxDict:
221
+ elif Table2DPlotServer.TABLE_COLUMNS in rxDict:
222
222
  self.server.parent.createNewPlot(rxDict[Table2DPlotServer.TABLE_COLUMNS])
223
223
 
224
224
  elif Table2DPlotServer.TABLE_ROW in rxDict:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p3lib
3
- Version: 1.1.70
3
+ Version: 1.1.72
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
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: paramiko >=2.9.3
16
- Requires-Dist: pillow >=9.2.0
15
+ Requires-Dist: paramiko>=2.9.3
16
+ Requires-Dist: pillow>=9.2.0
17
17
 
18
18
  # A Python3 library
19
19
  A group of python modules for networking, plotting data, config storage, automating boot scripts, ssh access and user input output.
@@ -11,11 +11,11 @@ p3lib/mqtt_rpc.py,sha256=6LmFA1kR4HSJs9eWbOJORRHNY01L_lHWjvtE2fmY8P8,10511
11
11
  p3lib/netif.py,sha256=3QV5OGdHhELIf4MBj6mx5MNCtVeZ7JXoNEkeu4KzCaE,9796
12
12
  p3lib/netplotly.py,sha256=PMDx-w1jtRVW6Od5u_kuKbBxNpTS_Y88mMF60puMxLM,9363
13
13
  p3lib/pconfig.py,sha256=_ri9w3aauHXZp8u2YLYHBVroFR_iCqaTCwj_MRa3rHo,30153
14
- p3lib/ssh.py,sha256=-w_2oQWZaIABanF1lk8fRyMLkJK231Bvy11StgdYqJg,38951
15
- p3lib/table_plot.py,sha256=z1-cjE879fi2fZ92LybxaP6BcEYp4HJIwzNVDAi8U_E,32140
14
+ p3lib/ssh.py,sha256=JiO9MY98zf3uqbonygJi_F9X0eAAgHAINCTeBuYXpCY,39511
15
+ p3lib/table_plot.py,sha256=dRPZ9rFpwE9Dpyqrvbm5t2spVaPSHrx_B7KvfWVND3g,32166
16
16
  p3lib/uio.py,sha256=hMarPnYXnqVF23HUIeDfzREo7TMdBjrupXMY_ffuCbI,23133
17
- p3lib-1.1.70.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
18
- p3lib-1.1.70.dist-info/METADATA,sha256=Htc0H5UnbjKtfpJR6SPlJG5JYWUuxQGCOBRfpKsimPk,920
19
- p3lib-1.1.70.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
20
- p3lib-1.1.70.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
21
- p3lib-1.1.70.dist-info/RECORD,,
17
+ p3lib-1.1.72.dist-info/LICENSE,sha256=igqTy5u0kVWM1n-NUZMvAlinY6lVjAXKoag0okkS8V8,1067
18
+ p3lib-1.1.72.dist-info/METADATA,sha256=Ls1Hl5rIvy8fuzOJj1HF2zp3ccNx72WJunsCKmVpgyg,918
19
+ p3lib-1.1.72.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
20
+ p3lib-1.1.72.dist-info/top_level.txt,sha256=SDCpXYh-19yCFp4Z8ZK4B-3J4NvTCJElZ42NPgcR6-U,6
21
+ p3lib-1.1.72.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (72.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5