qplotter 1.6.0__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.
Files changed (130) hide show
  1. qplot/__init__.py +46 -0
  2. qplot/__main__.py +232 -0
  3. qplot/_auxiliary_paths.py +67 -0
  4. qplot/_build_info.json +1 -0
  5. qplot/_metadata.py +75 -0
  6. qplot/_repair.py +14 -0
  7. qplot/_shutdown_supervisor.py +4049 -0
  8. qplot/_version.py +12 -0
  9. qplot/_windows_shutdown_job.py +1166 -0
  10. qplot/configuration/__init__.py +3 -0
  11. qplot/configuration/config.py +578 -0
  12. qplot/configuration/config_schema.json +357 -0
  13. qplot/configuration/fonts.py +3 -0
  14. qplot/configuration/scripts.py +255 -0
  15. qplot/configuration/themes/__init__.py +13 -0
  16. qplot/configuration/themes/_base.py +592 -0
  17. qplot/configuration/themes/blank.py +17 -0
  18. qplot/configuration/themes/dark.py +54 -0
  19. qplot/configuration/themes/light.py +54 -0
  20. qplot/datahandling/LoadFromDB.py +224 -0
  21. qplot/datahandling/__init__.py +47 -0
  22. qplot/datahandling/_trusted_live_helper.py +812 -0
  23. qplot/datahandling/_trusted_live_protocol.py +1745 -0
  24. qplot/datahandling/database.py +2340 -0
  25. qplot/datahandling/dimensions.py +43 -0
  26. qplot/datahandling/file_identity.py +461 -0
  27. qplot/datahandling/parameter_data.py +149 -0
  28. qplot/datahandling/plot_progress.py +17 -0
  29. qplot/datahandling/qcodes_cache.py +277 -0
  30. qplot/datahandling/qcodes_compat.py +14 -0
  31. qplot/datahandling/readSQL.py +2442 -0
  32. qplot/datahandling/readonly.py +2566 -0
  33. qplot/datahandling/source_activity.py +21 -0
  34. qplot/datahandling/trusted_array_preview.py +148 -0
  35. qplot/datahandling/trusted_derived_cache.py +1605 -0
  36. qplot/datahandling/trusted_derived_rendering.py +876 -0
  37. qplot/datahandling/trusted_heatmap.py +246 -0
  38. qplot/datahandling/trusted_live.py +2808 -0
  39. qplot/datahandling/trusted_live_queries.py +5907 -0
  40. qplot/datahandling/trusted_live_service.py +1919 -0
  41. qplot/datahandling/trusted_live_supervisor.py +2161 -0
  42. qplot/datahandling/trusted_plot.py +283 -0
  43. qplot/datahandling/trusted_presentation.py +1065 -0
  44. qplot/datahandling/trusted_snapshot.py +1132 -0
  45. qplot/datahandling/trusted_work_coordinator.py +2157 -0
  46. qplot/datahandling/trusted_work_scheduler.py +1204 -0
  47. qplot/diagnostics.py +241 -0
  48. qplot/resources/testdata/qplot_test_db_01_10mb.csv +11 -0
  49. qplot/resources/testdata/qplot_test_db_02_25mb.csv +14 -0
  50. qplot/resources/testdata/qplot_test_db_03_50mb.csv +17 -0
  51. qplot/resources/testdata/qplot_test_db_04_100mb.csv +20 -0
  52. qplot/resources/testdata/qplot_test_db_05_250mb.csv +23 -0
  53. qplot/resources/testdata/qplot_test_db_06_500mb.csv +26 -0
  54. qplot/resources/testdata/qplot_test_db_07_1gb.csv +29 -0
  55. qplot/resources/testdata/qplot_test_db_08_5gb.csv +32 -0
  56. qplot/resources/testdata/qplot_test_db_09_10gb.csv +35 -0
  57. qplot/resources/testdata/qplot_test_db_10_30gb.csv +38 -0
  58. qplot/testdata.py +1804 -0
  59. qplot/tools/__init__.py +13 -0
  60. qplot/tools/finite_means.py +123 -0
  61. qplot/tools/general.py +139 -0
  62. qplot/tools/heatmap_geometry.py +391 -0
  63. qplot/tools/operation_registry.py +179 -0
  64. qplot/tools/plot_tools.py +650 -0
  65. qplot/tools/sample_statistics.py +111 -0
  66. qplot/tools/worker.py +2838 -0
  67. qplot/windows/__init__.py +9 -0
  68. qplot/windows/_colorbar.py +422 -0
  69. qplot/windows/_commands.py +523 -0
  70. qplot/windows/_config_persistence.py +123 -0
  71. qplot/windows/_database_actions.py +4933 -0
  72. qplot/windows/_dataset_handle.py +221 -0
  73. qplot/windows/_display_precision.py +48 -0
  74. qplot/windows/_dragdrop.py +70 -0
  75. qplot/windows/_export_paths.py +1167 -0
  76. qplot/windows/_help.py +210 -0
  77. qplot/windows/_mixed_appearance.py +303 -0
  78. qplot/windows/_mixed_plots.py +461 -0
  79. qplot/windows/_native_averaging.py +323 -0
  80. qplot/windows/_native_transforms.py +551 -0
  81. qplot/windows/_plot1d_snap.py +612 -0
  82. qplot/windows/_plot1d_traces.py +2236 -0
  83. qplot/windows/_plot2d_colorbar.py +1127 -0
  84. qplot/windows/_plot2d_colorbar_dialog.py +786 -0
  85. qplot/windows/_plot2d_layers.py +2291 -0
  86. qplot/windows/_plot2d_sweeps.py +712 -0
  87. qplot/windows/_plotWin.py +2082 -0
  88. qplot/windows/_plot_actions.py +2703 -0
  89. qplot/windows/_plot_annotation.py +186 -0
  90. qplot/windows/_plot_appearance.py +283 -0
  91. qplot/windows/_plot_axis_scaling.py +1521 -0
  92. qplot/windows/_plot_data_viewbox.py +94 -0
  93. qplot/windows/_plot_drop_axes.py +224 -0
  94. qplot/windows/_plot_export.py +1445 -0
  95. qplot/windows/_plot_feedback.py +112 -0
  96. qplot/windows/_plot_marquee.py +659 -0
  97. qplot/windows/_plot_refresh.py +950 -0
  98. qplot/windows/_plot_source_promotion.py +178 -0
  99. qplot/windows/_plot_state.py +237 -0
  100. qplot/windows/_plot_status.py +115 -0
  101. qplot/windows/_plot_tiling.py +35 -0
  102. qplot/windows/_plot_transform_labels.py +60 -0
  103. qplot/windows/_preferences.py +724 -0
  104. qplot/windows/_refresh_interval.py +172 -0
  105. qplot/windows/_run_controls.py +789 -0
  106. qplot/windows/_shortcuts.py +47 -0
  107. qplot/windows/_subplots/__init__.py +8 -0
  108. qplot/windows/_subplots/subplot1d.py +532 -0
  109. qplot/windows/_subplots/subplot2d.py +919 -0
  110. qplot/windows/_svg_export.py +209 -0
  111. qplot/windows/_trusted_derived_qt.py +1759 -0
  112. qplot/windows/_widgets/__init__.py +23 -0
  113. qplot/windows/_widgets/_run_formatting.py +387 -0
  114. qplot/windows/_widgets/details_tables.py +1119 -0
  115. qplot/windows/_widgets/dropbox.py +290 -0
  116. qplot/windows/_widgets/operations.py +460 -0
  117. qplot/windows/_widgets/preview.py +2997 -0
  118. qplot/windows/_widgets/run_list_items.py +488 -0
  119. qplot/windows/_widgets/toolbar.py +111 -0
  120. qplot/windows/_widgets/treeWidgets.py +2572 -0
  121. qplot/windows/_window_controls.py +414 -0
  122. qplot/windows/main.py +1632 -0
  123. qplot/windows/plot1d.py +313 -0
  124. qplot/windows/plot2d.py +1935 -0
  125. qplotter-1.6.0.dist-info/METADATA +322 -0
  126. qplotter-1.6.0.dist-info/RECORD +130 -0
  127. qplotter-1.6.0.dist-info/WHEEL +5 -0
  128. qplotter-1.6.0.dist-info/entry_points.txt +4 -0
  129. qplotter-1.6.0.dist-info/licenses/LICENSE +21 -0
  130. qplotter-1.6.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,357 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+
6
+ "GUI": {
7
+ "type": "object",
8
+ "properties": {
9
+ "plot_frame_fraction": {
10
+ "type": "number",
11
+ "exclusiveMinimum": 0,
12
+ "exclusiveMaximum": 1,
13
+ "default": 0.47
14
+ },
15
+ "main_frame_size": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "integer",
19
+ "minimum": 1,
20
+ "maximum": 16777215
21
+ },
22
+ "minItems": 2,
23
+ "maxItems": 2,
24
+ "default": [780, 700]
25
+ },
26
+ "preview_size": {
27
+ "type": "integer",
28
+ "minimum": 50,
29
+ "maximum": 1000,
30
+ "default": 200
31
+ },
32
+ "run_table_column_widths": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "integer",
36
+ "minimum": 32,
37
+ "maximum": 16777215
38
+ },
39
+ "oneOf": [
40
+ { "maxItems": 0 },
41
+ { "minItems": 12, "maxItems": 12 }
42
+ ],
43
+ "default": []
44
+ },
45
+ "run_table_visible_columns": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "string",
49
+ "enum": [
50
+ "run_id",
51
+ "experiment",
52
+ "sample",
53
+ "measurements",
54
+ "setpoints",
55
+ "name",
56
+ "started",
57
+ "completed",
58
+ "status",
59
+ "duration",
60
+ "size",
61
+ "guid"
62
+ ]
63
+ },
64
+ "uniqueItems": true,
65
+ "maxItems": 12,
66
+ "default": [
67
+ "run_id",
68
+ "measurements",
69
+ "setpoints",
70
+ "started",
71
+ "status",
72
+ "duration",
73
+ "size"
74
+ ]
75
+ }
76
+ },
77
+ "required": [
78
+ "plot_frame_fraction",
79
+ "main_frame_size",
80
+ "preview_size",
81
+ "run_table_column_widths",
82
+ "run_table_visible_columns"
83
+ ],
84
+ "additionalProperties": false
85
+ },
86
+
87
+ "file": {
88
+ "type": "object",
89
+ "properties": {
90
+ "default_load_path": {
91
+ "type": "string",
92
+ "default": ""
93
+ },
94
+ "recent_file_paths": {
95
+ "type": "array",
96
+ "items": { "type": "string" },
97
+ "uniqueItems": true,
98
+ "maxItems": 10,
99
+ "default": []
100
+ }
101
+ },
102
+ "required": ["default_load_path", "recent_file_paths"],
103
+ "additionalProperties": false
104
+ },
105
+
106
+ "user_preference": {
107
+ "type": "object",
108
+ "properties": {
109
+ "show_source_annotation": {
110
+ "type": "boolean",
111
+ "default": true
112
+ },
113
+ "cursor_significant_figures": {
114
+ "type": "integer",
115
+ "minimum": 1,
116
+ "maximum": 17,
117
+ "default": 6
118
+ },
119
+ "font_size": {
120
+ "type": "integer",
121
+ "minimum": 6,
122
+ "maximum": 36,
123
+ "default": 10
124
+ },
125
+ "plot_tile_rows": {
126
+ "type": "integer",
127
+ "minimum": 1,
128
+ "maximum": 10,
129
+ "default": 2
130
+ },
131
+ "plot_tile_columns": {
132
+ "type": "integer",
133
+ "minimum": 1,
134
+ "maximum": 10,
135
+ "default": 2
136
+ },
137
+ "theme":{
138
+ "type": "string",
139
+ "enum": ["light", "dark", "pyqt"],
140
+ "default": "light"
141
+ },
142
+ "bar_colour" : {
143
+ "type": "string",
144
+ "default": "viridis"
145
+ },
146
+ "colorbar_width": {
147
+ "type": "integer",
148
+ "minimum": 1,
149
+ "maximum": 500,
150
+ "default": 15
151
+ },
152
+ "axis_tick_width": {
153
+ "type": "number",
154
+ "minimum": 0.5,
155
+ "maximum": 10,
156
+ "default": 2
157
+ },
158
+ "axis_major_tick_count": {
159
+ "type": "integer",
160
+ "minimum": 2,
161
+ "maximum": 10,
162
+ "default": 3
163
+ },
164
+ "bar_colour_include_cet": {
165
+ "type": "boolean",
166
+ "default": true
167
+ },
168
+ "bar_colour_include_matplotlib": {
169
+ "type": "boolean",
170
+ "default": true
171
+ },
172
+ "bar_colour_include_local": {
173
+ "type": "boolean",
174
+ "default": true
175
+ },
176
+ "bar_colour_include_custom": {
177
+ "type": "boolean",
178
+ "default": true
179
+ },
180
+ "bar_colour_include_cet_linear": {
181
+ "type": "boolean",
182
+ "default": true
183
+ },
184
+ "bar_colour_include_cet_divergent": {
185
+ "type": "boolean",
186
+ "default": true
187
+ },
188
+ "bar_colour_include_cet_cyclic": {
189
+ "type": "boolean",
190
+ "default": true
191
+ },
192
+ "bar_colour_include_cet_rainbow": {
193
+ "type": "boolean",
194
+ "default": true
195
+ },
196
+ "bar_colour_include_cet_isoluminant": {
197
+ "type": "boolean",
198
+ "default": true
199
+ },
200
+ "bar_colour_include_cet_other": {
201
+ "type": "boolean",
202
+ "default": true
203
+ },
204
+ "bar_colour_include_matplotlib_perceptual": {
205
+ "type": "boolean",
206
+ "default": true
207
+ },
208
+ "bar_colour_include_matplotlib_sequential": {
209
+ "type": "boolean",
210
+ "default": true
211
+ },
212
+ "bar_colour_include_matplotlib_divergent": {
213
+ "type": "boolean",
214
+ "default": true
215
+ },
216
+ "bar_colour_include_matplotlib_cyclic": {
217
+ "type": "boolean",
218
+ "default": true
219
+ },
220
+ "bar_colour_include_matplotlib_qualitative": {
221
+ "type": "boolean",
222
+ "default": true
223
+ },
224
+ "bar_colour_include_matplotlib_other": {
225
+ "type": "boolean",
226
+ "default": true
227
+ },
228
+ "bar_colour_excluded": {
229
+ "type": "array",
230
+ "items": { "type": "string" },
231
+ "default": []
232
+ },
233
+ "bar_colour_excluded_prefixes": {
234
+ "type": "array",
235
+ "items": { "type": "string" },
236
+ "default": []
237
+ },
238
+ "confirm_close": {
239
+ "type": "boolean",
240
+ "default": true
241
+ },
242
+ "confirm_close_all": {
243
+ "type": "boolean",
244
+ "default": true
245
+ },
246
+ "confirm_incompatible_axes": {
247
+ "type": "boolean",
248
+ "default": true
249
+ },
250
+ "mouse_mode": {
251
+ "type": "string",
252
+ "enum": ["pan", "rect"],
253
+ "default": "pan"
254
+ },
255
+ "copy_plot_image_resolution": {
256
+ "type": "string",
257
+ "enum": ["screen", "dpi_300", "svg"],
258
+ "default": "screen"
259
+ },
260
+ "auto_plot": {
261
+ "type": "boolean",
262
+ "default": false
263
+ },
264
+ "default_refresh_rate": {
265
+ "type": "number",
266
+ "minimum": 0,
267
+ "maximum": 10000,
268
+ "default": 1
269
+ }
270
+ },
271
+ "required": [
272
+ "theme",
273
+ "show_source_annotation",
274
+ "font_size",
275
+ "cursor_significant_figures",
276
+ "plot_tile_rows",
277
+ "plot_tile_columns",
278
+ "bar_colour",
279
+ "colorbar_width",
280
+ "axis_tick_width",
281
+ "axis_major_tick_count",
282
+ "bar_colour_include_cet",
283
+ "bar_colour_include_matplotlib",
284
+ "bar_colour_include_local",
285
+ "bar_colour_include_custom",
286
+ "bar_colour_include_cet_linear",
287
+ "bar_colour_include_cet_divergent",
288
+ "bar_colour_include_cet_cyclic",
289
+ "bar_colour_include_cet_rainbow",
290
+ "bar_colour_include_cet_isoluminant",
291
+ "bar_colour_include_cet_other",
292
+ "bar_colour_include_matplotlib_perceptual",
293
+ "bar_colour_include_matplotlib_sequential",
294
+ "bar_colour_include_matplotlib_divergent",
295
+ "bar_colour_include_matplotlib_cyclic",
296
+ "bar_colour_include_matplotlib_qualitative",
297
+ "bar_colour_include_matplotlib_other",
298
+ "bar_colour_excluded",
299
+ "bar_colour_excluded_prefixes",
300
+ "confirm_close",
301
+ "confirm_close_all",
302
+ "confirm_incompatible_axes",
303
+ "mouse_mode",
304
+ "copy_plot_image_resolution",
305
+ "auto_plot",
306
+ "default_refresh_rate"
307
+ ],
308
+ "additionalProperties": false
309
+ },
310
+
311
+ "runtime_settings": {
312
+ "type": "object",
313
+ "properties": {
314
+ "max_threads": {
315
+ "type": "integer",
316
+ "minimum": 1,
317
+ "maximum": 999,
318
+ "default": 4
319
+ },
320
+ "max_full_heatmap_points": {
321
+ "type": "integer",
322
+ "minimum": 1,
323
+ "maximum": 2000000000,
324
+ "default": 2000000
325
+ },
326
+ "max_heatmap_grid_cells": {
327
+ "type": "integer",
328
+ "minimum": 1,
329
+ "maximum": 2000000000,
330
+ "default": 250000
331
+ },
332
+ "max_heatmap_grid_side": {
333
+ "type": "integer",
334
+ "minimum": 1,
335
+ "maximum": 2000000000,
336
+ "default": 800
337
+ },
338
+ "del_grace_period": {
339
+ "type": "number",
340
+ "minimum": 0,
341
+ "maximum": 300,
342
+ "default": 10
343
+ },
344
+ "cloud_sync_timeout": {
345
+ "type": "number",
346
+ "minimum": 1,
347
+ "maximum": 3600,
348
+ "default": 120
349
+ }
350
+ },
351
+ "required": ["max_threads", "max_full_heatmap_points", "max_heatmap_grid_cells", "max_heatmap_grid_side", "del_grace_period", "cloud_sync_timeout"],
352
+ "additionalProperties": false
353
+ }
354
+ },
355
+ "required": ["GUI", "file", "user_preference", "runtime_settings"],
356
+ "additionalProperties": false
357
+ }
@@ -0,0 +1,3 @@
1
+ """Font-size preference for plot graphics."""
2
+
3
+ FONT_SIZE_KEY = "user_preference.font_size"
@@ -0,0 +1,255 @@
1
+ import json
2
+ import sys
3
+
4
+ from jsonschema import ValidationError
5
+
6
+ from qplot._metadata import package_version
7
+
8
+ from .config import config
9
+
10
+
11
+ class sysHandle:
12
+ """
13
+ Entry point for terminal/console based commands. Called through scripts,
14
+ which is set up in pyproject.toml.
15
+
16
+ This is somewhat Jerry-Rigged, fetching string following qplot-cfg and
17
+ converts them to command matching functions here.
18
+ """
19
+ def __init__(self, command, *args):
20
+
21
+ # Find valid commands by checking against class attributes which are callable
22
+ self.valid_args = [f"-{str(method_name)}" for method_name in dir(sysHandle)
23
+ if callable(getattr(sysHandle, method_name))
24
+ and method_name[0] != "_"]
25
+
26
+ # Convert command str to callable
27
+ if command in self.valid_args:
28
+ func = getattr(self, command[1:])
29
+ else:
30
+ key = f"Command: ({command}), not found. Valid options: {self.valid_args}"
31
+ raise KeyError(key)
32
+
33
+ self._config = None
34
+ func(*args) # Pass other arguments to func
35
+
36
+ @property
37
+ def config(self):
38
+ """Create the configuration only for commands that access it."""
39
+ if self._config is None:
40
+ self._config = config()
41
+ return self._config
42
+
43
+ def dump(self):
44
+ """
45
+ -dump
46
+ -----
47
+ Prints the location of the config.json file along with its full
48
+ contents
49
+
50
+ """
51
+ self.config.dump()
52
+
53
+ def reset(self):
54
+ """
55
+ -reset
56
+ ------
57
+ Reset all config.json values to their defaults and prints new config
58
+ file
59
+
60
+
61
+ """
62
+ self.config.reset_to_defaults()
63
+ print("Config reset:")
64
+ self.dump()
65
+
66
+ def find(self, key : str):
67
+ """
68
+ -find
69
+ -----
70
+ Returns the key and the value assiated with that key.
71
+ key must be laid out as a dot (.) seperated path, i.e.
72
+ qplot-cfg -find GUI.main_frame_size
73
+
74
+ Parameters
75
+ ----------
76
+ key : str
77
+ Location of value to fetch.
78
+
79
+ Raises
80
+ ------
81
+ KeyError
82
+ Key not found in file
83
+
84
+ """
85
+ print(f"{key}:\t{self.config.get(key)}")
86
+
87
+ def set_value(
88
+ self,
89
+ key : str,
90
+ value: str,
91
+ ):
92
+ """
93
+ -set_value
94
+ ----------
95
+ Sets the value in the config.json file, located at key.
96
+
97
+ > key must be laid out as a dot (.) seperated path, i.e.
98
+ qplot-cfg -set_value user_preference.theme dark
99
+ or
100
+ qplot-cfg -set_value GUI.plot_frame_fraction 0.25
101
+
102
+ > If value has spaces in it, speech marks are required around it
103
+ qplot-cfg -set_value file.default_load_path "./file/with space"
104
+
105
+ Parameters
106
+ ----------
107
+ key : str
108
+ Location of the value to change.
109
+ value : [str, list, int, float]
110
+ Value to be changed to.
111
+
112
+ Raises
113
+ ------
114
+ KeyError
115
+ Key passed is not located in config.json
116
+ ValidationError
117
+ Value type is incorrect for corresponding key.
118
+
119
+ """
120
+
121
+ #check if key is valid
122
+ self.config.get(key)
123
+
124
+ try:
125
+ convrt_value = _config_value(value, self.config.schema_for(key))
126
+ self.config.update(key, convrt_value)
127
+ except (TypeError, ValueError, json.JSONDecodeError, ValidationError) as error:
128
+ err_key = f"Value: {value}, is invalid."
129
+ err_key += str(error)
130
+ raise ValidationError(err_key) from error
131
+ print(f"set '{key}' to '{value}'")
132
+
133
+
134
+ def info(self, attr: str | None = None):
135
+ """
136
+ -info
137
+ -----
138
+ Gets infomation about callable functions.
139
+
140
+ 'qplot-cfg -info' lists all callable functions
141
+ 'qplot-cfg -info <attr>' produces the docstring of the function
142
+ Note: the '-' before <attr> can be ommited
143
+
144
+ Parameters
145
+ ----------
146
+ attr : callable, optional
147
+ Produces the docstring of command attr. If none are given, prints
148
+ all commands
149
+
150
+ Raises
151
+ ------
152
+ KeyError
153
+ Invalid command was given.
154
+
155
+ """
156
+ if not attr:
157
+ print(f"Valid Commands:\n\t{self.valid_args}\nUse 'qplot-cfg -info <command>' for more info")
158
+ return
159
+ elif attr in self.valid_args:
160
+ func = getattr(self, attr[1:])
161
+ elif ("-"+attr) in self.valid_args:
162
+ func = getattr(self, attr)
163
+ else:
164
+ raise KeyError(f"Command: ({attr}), not found. Valid options: {self.valid_args}, '-' may be ommited")
165
+
166
+ print(func.__doc__)
167
+
168
+
169
+ def version(self):
170
+ """
171
+ -version
172
+ --------
173
+ Prints the installed qPlot package version.
174
+
175
+ """
176
+ print(package_version())
177
+
178
+
179
+ def try_as_num(item):
180
+ """
181
+ Attempts to convert str to float or int.
182
+
183
+ Parameters
184
+ ----------
185
+ item : str
186
+ item to be converted.
187
+
188
+ Returns
189
+ -------
190
+ item : int, float, str
191
+ The item after conversions.
192
+
193
+ """
194
+ try:
195
+ item = item.strip()
196
+ if "." in item or "e" in item.lower():
197
+ item = float(item)
198
+ else:
199
+ item = int(item)
200
+ except ValueError: #if cannot conver to int or float
201
+ item = str(item)
202
+ return item
203
+
204
+
205
+ def _config_value(value, schema):
206
+ """Parse a command-line value according to its target config schema."""
207
+
208
+ value_type = schema.get("type")
209
+ stripped = value.strip()
210
+
211
+ if value_type == "string":
212
+ return value
213
+ if value_type == "boolean":
214
+ if stripped.lower() == "true":
215
+ return True
216
+ if stripped.lower() == "false":
217
+ return False
218
+ raise ValueError("expected true or false")
219
+ if value_type == "integer":
220
+ return int(stripped, 10)
221
+ if value_type == "number":
222
+ return float(stripped)
223
+ if value_type == "array":
224
+ if not (
225
+ (stripped.startswith("[") and stripped.endswith("]"))
226
+ or (stripped.startswith("(") and stripped.endswith(")"))
227
+ ):
228
+ raise ValueError("expected a bracketed list")
229
+ json_list = f"[{stripped[1:-1]}]"
230
+ try:
231
+ return json.loads(json_list)
232
+ except json.JSONDecodeError:
233
+ inner = stripped[1:-1].strip()
234
+ if not inner:
235
+ return []
236
+ item_schema = schema.get("items", {})
237
+ return [
238
+ _config_value(item.strip(), item_schema)
239
+ for item in inner.split(",")
240
+ ]
241
+
242
+ return try_as_num(value)
243
+
244
+
245
+ def scripts():
246
+ """
247
+ The actual entry point which call sysHandle to manage commands
248
+
249
+ """
250
+ # Fetch str based command from command line
251
+ args=sys.argv
252
+ if len(args) == 1:
253
+ sysHandle("-info")
254
+ else:
255
+ sysHandle(*args[1:])
@@ -0,0 +1,13 @@
1
+ """
2
+ Files within here contain code in CSS to format the stylesheet of the windows.
3
+ """
4
+
5
+ from .blank import blank as pyqt
6
+ from .dark import dark
7
+ from .light import light
8
+
9
+ __all__=[
10
+ "light",
11
+ "dark",
12
+ "pyqt",
13
+ ]