happyscript 0.0.61__tar.gz → 0.0.62__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.
- happyscript-0.0.62/PKG-INFO +72 -0
- happyscript-0.0.62/README.md +54 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/__init__.py +1 -1
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/panels/panel_tests.py +6 -6
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/scriptmanager.py +16 -11
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/staticscriptmanager.py +51 -13
- happyscript-0.0.62/happyscript.egg-info/PKG-INFO +72 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/pyproject.toml +1 -1
- happyscript-0.0.61/PKG-INFO +0 -44
- happyscript-0.0.61/README.md +0 -26
- happyscript-0.0.61/happyscript.egg-info/PKG-INFO +0 -44
- {happyscript-0.0.61 → happyscript-0.0.62}/LICENSE +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/__init__.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/chart.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/histogram_chart.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/histogram_series.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/matplotlib_chart.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/panel_charts.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/scatter_chart.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/scatter_series.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/time_chart.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/charts/time_series.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/forms/form_askchoice.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/forms/form_askimage.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/forms/form_main.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/forms/form_main_base.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/forms/form_ontestfailure.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/forms/form_serials.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/forms/form_settings.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/forms/form_stop.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/forms/formsbase.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/imglib.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/inifile.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/modulereader.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/panels/panel_log.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/panels/panel_messages.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/panels/panel_scripts2.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/panels/panelsbase.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/scriptartwork.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/scriptcontrol.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/scriptexceptions.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/scriptgui.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/scriptinfo.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/scriptparams.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/scriptreader.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/scriptrunner.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/splashmenu/__init__.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/splashmenu/exit.png +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/splashmenu/forms.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/splashmenu/splashmenuform.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/splashmenu/splashmenumain.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/testlog/global_log_handler.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/testlog/log_to_text.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/testlog/logtoxml.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/testlog/printredirect.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/testloghandler.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/userpanel/userpanel.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript/userpanel/userpanelvalue.py +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript.egg-info/SOURCES.txt +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript.egg-info/dependency_links.txt +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript.egg-info/requires.txt +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/happyscript.egg-info/top_level.txt +0 -0
- {happyscript-0.0.61 → happyscript-0.0.62}/setup.cfg +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: happyscript
|
|
3
|
+
Version: 0.0.62
|
|
4
|
+
Summary: GUI framework for running python scripts in a test or production environment
|
|
5
|
+
Author: Marc Van Riet
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Project-URL: Documentation, https://happyscript.readthedocs.io
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering
|
|
13
|
+
Requires-Python: >=3.5
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: wxpython
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
**Happyscript** is a framework intended for running Python scripts against electronic hardware
|
|
23
|
+
and test equipment in an engineering or production environment.
|
|
24
|
+
|
|
25
|
+
It offers :
|
|
26
|
+
|
|
27
|
+
* tabbed GUI
|
|
28
|
+
* logging window with command line with history
|
|
29
|
+
* script selection from a treeview
|
|
30
|
+
* predefined test lists
|
|
31
|
+
* Python console with code completion
|
|
32
|
+
* basic charts
|
|
33
|
+
* easy GUI functions for user interaction
|
|
34
|
+
* easy panels with user controls
|
|
35
|
+
* .ini-file settings window
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Just use `pip install happyscript`. This will also install wxpython, which is the only dependency.
|
|
40
|
+
|
|
41
|
+
Matplotlib can be used for charts, but you have to install this manually. It is not added as dependency to keep the number of dependencies low.
|
|
42
|
+
|
|
43
|
+
## ScriptManager
|
|
44
|
+
|
|
45
|
+
The [ScriptManager](https://happyscript.readthedocs.io/en/latest/script_manager/) object takes care of the GUI. The minimal program is this :
|
|
46
|
+
``` py
|
|
47
|
+
import happyscript
|
|
48
|
+
mngr = happyscript.ScriptManager()
|
|
49
|
+
mngr.run()
|
|
50
|
+
```
|
|
51
|
+
This will give you a main window with a lot of options, depending on the type of user. Click the leftmost icon in the menu bar to enable more options.
|
|
52
|
+
|
|
53
|
+
You can get an idea of the possibilities by looking at the tutorial on [github](https://github.com/mvanriet/happyscript/tree/main/examples/tutorial/). Further information will be gradually added on [ReadTheDocs](https://happyscript.readthedocs.io/en/latest/).
|
|
54
|
+
|
|
55
|
+
Since `ScriptManager` loads its Python scripts dynamically, the resulting application cannot be converted to a static executable. To allow this anyway, there is a variant [StaticScriptManager](https://happyscript.readthedocs.io/en/latest/static_script_manager/) which is similar, but requires you to import the scripts explicitly, and therefore does not offer script reloads.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Splashmenu
|
|
59
|
+
|
|
60
|
+
Sometimes the user needs a nice menu to select different things to test.
|
|
61
|
+
|
|
62
|
+
This is easy to implement using the [SplashMenu](https://happyscript.readthedocs.io/en/latest/splashmenu/) object. This code will show buttons for two tests, and an 'exit' sign :
|
|
63
|
+
``` python
|
|
64
|
+
import happyscript
|
|
65
|
+
menu = happyscript.SplashMenu(__file__, 2, 2)
|
|
66
|
+
menu.set_button(1,1, "image1.png", "test1.py")
|
|
67
|
+
menu.set_button(2,1, "subdir/another_image.png", "subdir/another_test.exe", "COM1:" )
|
|
68
|
+
menu.run()
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
See the [examples](https://github.com/mvanriet/happyscript/tree/main/examples/splashmenu) for a demo.
|
|
72
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
**Happyscript** is a framework intended for running Python scripts against electronic hardware
|
|
5
|
+
and test equipment in an engineering or production environment.
|
|
6
|
+
|
|
7
|
+
It offers :
|
|
8
|
+
|
|
9
|
+
* tabbed GUI
|
|
10
|
+
* logging window with command line with history
|
|
11
|
+
* script selection from a treeview
|
|
12
|
+
* predefined test lists
|
|
13
|
+
* Python console with code completion
|
|
14
|
+
* basic charts
|
|
15
|
+
* easy GUI functions for user interaction
|
|
16
|
+
* easy panels with user controls
|
|
17
|
+
* .ini-file settings window
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Just use `pip install happyscript`. This will also install wxpython, which is the only dependency.
|
|
22
|
+
|
|
23
|
+
Matplotlib can be used for charts, but you have to install this manually. It is not added as dependency to keep the number of dependencies low.
|
|
24
|
+
|
|
25
|
+
## ScriptManager
|
|
26
|
+
|
|
27
|
+
The [ScriptManager](https://happyscript.readthedocs.io/en/latest/script_manager/) object takes care of the GUI. The minimal program is this :
|
|
28
|
+
``` py
|
|
29
|
+
import happyscript
|
|
30
|
+
mngr = happyscript.ScriptManager()
|
|
31
|
+
mngr.run()
|
|
32
|
+
```
|
|
33
|
+
This will give you a main window with a lot of options, depending on the type of user. Click the leftmost icon in the menu bar to enable more options.
|
|
34
|
+
|
|
35
|
+
You can get an idea of the possibilities by looking at the tutorial on [github](https://github.com/mvanriet/happyscript/tree/main/examples/tutorial/). Further information will be gradually added on [ReadTheDocs](https://happyscript.readthedocs.io/en/latest/).
|
|
36
|
+
|
|
37
|
+
Since `ScriptManager` loads its Python scripts dynamically, the resulting application cannot be converted to a static executable. To allow this anyway, there is a variant [StaticScriptManager](https://happyscript.readthedocs.io/en/latest/static_script_manager/) which is similar, but requires you to import the scripts explicitly, and therefore does not offer script reloads.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Splashmenu
|
|
41
|
+
|
|
42
|
+
Sometimes the user needs a nice menu to select different things to test.
|
|
43
|
+
|
|
44
|
+
This is easy to implement using the [SplashMenu](https://happyscript.readthedocs.io/en/latest/splashmenu/) object. This code will show buttons for two tests, and an 'exit' sign :
|
|
45
|
+
``` python
|
|
46
|
+
import happyscript
|
|
47
|
+
menu = happyscript.SplashMenu(__file__, 2, 2)
|
|
48
|
+
menu.set_button(1,1, "image1.png", "test1.py")
|
|
49
|
+
menu.set_button(2,1, "subdir/another_image.png", "subdir/another_test.exe", "COM1:" )
|
|
50
|
+
menu.run()
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
See the [examples](https://github.com/mvanriet/happyscript/tree/main/examples/splashmenu) for a demo.
|
|
54
|
+
|
|
@@ -133,12 +133,12 @@ class PanelTests( PanelTests_Base):
|
|
|
133
133
|
self.m_lstTests.SetColumnWidth(1, width-110)
|
|
134
134
|
event.Skip()
|
|
135
135
|
|
|
136
|
-
def OnListRightClick( self, event ):
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
# def OnListRightClick( self, event ):
|
|
137
|
+
# self.selected_row = event.Index
|
|
138
|
+
# print( self.selected_row )
|
|
139
|
+
# pos = wx.GetMousePosition()
|
|
140
|
+
# pos = self.ScreenToClient( pos )
|
|
141
|
+
# self.PopupMenu( self.m_mnuTestList, pos )
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
|
|
@@ -18,17 +18,18 @@ from .scriptreader import ScriptReader
|
|
|
18
18
|
from .staticscriptmanager import StaticScriptManager
|
|
19
19
|
|
|
20
20
|
class ScriptManager(StaticScriptManager):
|
|
21
|
-
'''
|
|
22
|
-
classdocs
|
|
21
|
+
''' A subclass of StaticScriptManager that allows live reloading of test scripts.
|
|
23
22
|
'''
|
|
24
23
|
|
|
25
24
|
def __init__(self, title:str=None, colors = None, use_yaml:bool=False):
|
|
26
|
-
'''
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
''' Constructor
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
title (str): title for main window.
|
|
29
|
+
colors (list): color scheme for test list :
|
|
31
30
|
0=green, 1=blue, 2=yellow, 3=grey, 4=orange, 5=darker blue
|
|
31
|
+
use_yaml (bool): whether to use YAML when writing an info file. Standard is json.
|
|
32
|
+
|
|
32
33
|
'''
|
|
33
34
|
super().__init__(title=title, colors=colors, use_yaml=use_yaml) # call parent constructor
|
|
34
35
|
|
|
@@ -37,10 +38,14 @@ class ScriptManager(StaticScriptManager):
|
|
|
37
38
|
#============================================================================================================
|
|
38
39
|
|
|
39
40
|
def add_scripts(self, script_dir:str, group_name:str = None):
|
|
40
|
-
''' Reads scripts from a directory.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
''' Reads scripts from a directory.
|
|
42
|
+
All python files in the directory will be scanned for test functions.
|
|
43
|
+
A new tab will be added in the 'scripts' panel, and
|
|
44
|
+
all the files and their test functions will be shown in a treeview.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
script_dir (str): Full path to the directory with scripts
|
|
48
|
+
group_name (str): Name for this set of scripts. Dirname will be used if not specified.
|
|
44
49
|
'''
|
|
45
50
|
full_path = os.path.normpath(os.path.abspath(script_dir))
|
|
46
51
|
self.logger.info( "Adding scripts in %s" % full_path )
|
|
@@ -216,14 +216,21 @@ class StaticScriptManager(object):
|
|
|
216
216
|
# P A R A M E T E R S
|
|
217
217
|
#============================================================================================================
|
|
218
218
|
|
|
219
|
-
def add_object(self, objName, theObject):
|
|
219
|
+
def add_object(self, objName:str, theObject):
|
|
220
220
|
''' Add an object that can be used as parameter in the script functions.
|
|
221
|
+
|
|
222
|
+
Args:
|
|
223
|
+
objName (str): Name you want to give to this object. This must be a valid Python variable name.
|
|
224
|
+
theObject (any): The object to add, which can be accessed by the given name.
|
|
221
225
|
'''
|
|
222
226
|
self._script_params.add_object( objName, theObject)
|
|
223
227
|
|
|
224
228
|
def add_objects(self, *args, **kwargs):
|
|
225
|
-
''' Add
|
|
226
|
-
|
|
229
|
+
''' Add one or more object that can be used as parameter in the script functions.
|
|
230
|
+
|
|
231
|
+
Args:
|
|
232
|
+
*args : List of objects to add.
|
|
233
|
+
**kwargs : objects to add, with the name taken from the specified parameter name.
|
|
227
234
|
'''
|
|
228
235
|
self._script_params.add_objects(*args, **kwargs)
|
|
229
236
|
|
|
@@ -243,6 +250,17 @@ class StaticScriptManager(object):
|
|
|
243
250
|
|
|
244
251
|
def add_module(self, module, group_name=None):
|
|
245
252
|
''' Reads scripts from a python module.
|
|
253
|
+
All files in the directory will be scanned for test functions.
|
|
254
|
+
A new tab will be added in the 'scripts' panel, and
|
|
255
|
+
all the files and their test functions will be shown in a treeview.
|
|
256
|
+
The __init__.py file in the module should have an import for all python files you want to include.
|
|
257
|
+
|
|
258
|
+
Args:
|
|
259
|
+
module (module): The python module containing the scripts to add.
|
|
260
|
+
group_name (str): Name for this set of scripts. Module name will be used if not specified.
|
|
261
|
+
|
|
262
|
+
See Also:
|
|
263
|
+
[add_scripts()][happyscript.scriptmanager.ScriptManager.add_scripts]
|
|
246
264
|
'''
|
|
247
265
|
if group_name is None: # if no name given, use module name
|
|
248
266
|
group_name = module.__name__
|
|
@@ -261,7 +279,20 @@ class StaticScriptManager(object):
|
|
|
261
279
|
#============================================================================================================
|
|
262
280
|
|
|
263
281
|
def add_scripts(self, script_dir, group_name = None):
|
|
264
|
-
''' Reads scripts from a directory
|
|
282
|
+
''' Reads scripts from a directory.
|
|
283
|
+
All python files in the directory will be scanned for test functions.
|
|
284
|
+
A new tab will be added in the 'scripts' panel, and
|
|
285
|
+
all the files and their test functions will be shown in a treeview.
|
|
286
|
+
|
|
287
|
+
Note that this is not possible with StaticScriptManager. Use ScriptManager instead.
|
|
288
|
+
|
|
289
|
+
Args:
|
|
290
|
+
script_dir (str): Full path to the directory with scripts
|
|
291
|
+
group_name (str): Name for this set of scripts. Dirname will be used if not specified.
|
|
292
|
+
|
|
293
|
+
See Also:
|
|
294
|
+
[add_module()][happyscript.staticscriptmanager.StaticScriptManager.add_module]
|
|
295
|
+
|
|
265
296
|
'''
|
|
266
297
|
raise NotImplementedError("Scripts cannot be loaded dynamically by StaticScriptManager. Use ScriptManager instead.")
|
|
267
298
|
|
|
@@ -340,14 +371,18 @@ class StaticScriptManager(object):
|
|
|
340
371
|
# V A R I A
|
|
341
372
|
#============================================================================================================
|
|
342
373
|
|
|
343
|
-
def ask_serials(self, count, labels = None, filters=None, add_to_info=True):
|
|
374
|
+
def ask_serials(self, count, labels = None, filters=None, add_to_info=True) -> list[str] | None:
|
|
344
375
|
''' Show standard form for asking serial numbers.
|
|
345
376
|
The serials will be (by default) filled in in info, clearing any previous serials.
|
|
346
377
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
378
|
+
Args:
|
|
379
|
+
count (int): how many numbers : 1 - 5 numbers
|
|
380
|
+
labels (list of str): List of strings to show left from each serial number entry field
|
|
381
|
+
filters (list of str): regular expression for each serial number. Items can be None
|
|
382
|
+
add_to_info (bool): Whether to add the serials to the info object
|
|
383
|
+
|
|
384
|
+
Returns:
|
|
385
|
+
list of serial numbers, or None if the user pressed the 'Cancel' button
|
|
351
386
|
'''
|
|
352
387
|
serials = FormSerials.show(count, labels, filters)
|
|
353
388
|
|
|
@@ -361,10 +396,13 @@ class StaticScriptManager(object):
|
|
|
361
396
|
The panel constructor MUST have a parameter named 'parent'. This will be filled in
|
|
362
397
|
automatically with the object containing the new panel.
|
|
363
398
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
399
|
+
Args:
|
|
400
|
+
title (str): Title for the panel
|
|
401
|
+
panelType (type): class to instantiate
|
|
402
|
+
args: parameters to supply to the constructor of the class
|
|
403
|
+
|
|
404
|
+
Returns:
|
|
405
|
+
The newly created panel
|
|
368
406
|
'''
|
|
369
407
|
return self.dialog.AddCustomPanel(title, panelType, **args)
|
|
370
408
|
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: happyscript
|
|
3
|
+
Version: 0.0.62
|
|
4
|
+
Summary: GUI framework for running python scripts in a test or production environment
|
|
5
|
+
Author: Marc Van Riet
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Project-URL: Documentation, https://happyscript.readthedocs.io
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering
|
|
13
|
+
Requires-Python: >=3.5
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: wxpython
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
**Happyscript** is a framework intended for running Python scripts against electronic hardware
|
|
23
|
+
and test equipment in an engineering or production environment.
|
|
24
|
+
|
|
25
|
+
It offers :
|
|
26
|
+
|
|
27
|
+
* tabbed GUI
|
|
28
|
+
* logging window with command line with history
|
|
29
|
+
* script selection from a treeview
|
|
30
|
+
* predefined test lists
|
|
31
|
+
* Python console with code completion
|
|
32
|
+
* basic charts
|
|
33
|
+
* easy GUI functions for user interaction
|
|
34
|
+
* easy panels with user controls
|
|
35
|
+
* .ini-file settings window
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Just use `pip install happyscript`. This will also install wxpython, which is the only dependency.
|
|
40
|
+
|
|
41
|
+
Matplotlib can be used for charts, but you have to install this manually. It is not added as dependency to keep the number of dependencies low.
|
|
42
|
+
|
|
43
|
+
## ScriptManager
|
|
44
|
+
|
|
45
|
+
The [ScriptManager](https://happyscript.readthedocs.io/en/latest/script_manager/) object takes care of the GUI. The minimal program is this :
|
|
46
|
+
``` py
|
|
47
|
+
import happyscript
|
|
48
|
+
mngr = happyscript.ScriptManager()
|
|
49
|
+
mngr.run()
|
|
50
|
+
```
|
|
51
|
+
This will give you a main window with a lot of options, depending on the type of user. Click the leftmost icon in the menu bar to enable more options.
|
|
52
|
+
|
|
53
|
+
You can get an idea of the possibilities by looking at the tutorial on [github](https://github.com/mvanriet/happyscript/tree/main/examples/tutorial/). Further information will be gradually added on [ReadTheDocs](https://happyscript.readthedocs.io/en/latest/).
|
|
54
|
+
|
|
55
|
+
Since `ScriptManager` loads its Python scripts dynamically, the resulting application cannot be converted to a static executable. To allow this anyway, there is a variant [StaticScriptManager](https://happyscript.readthedocs.io/en/latest/static_script_manager/) which is similar, but requires you to import the scripts explicitly, and therefore does not offer script reloads.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Splashmenu
|
|
59
|
+
|
|
60
|
+
Sometimes the user needs a nice menu to select different things to test.
|
|
61
|
+
|
|
62
|
+
This is easy to implement using the [SplashMenu](https://happyscript.readthedocs.io/en/latest/splashmenu/) object. This code will show buttons for two tests, and an 'exit' sign :
|
|
63
|
+
``` python
|
|
64
|
+
import happyscript
|
|
65
|
+
menu = happyscript.SplashMenu(__file__, 2, 2)
|
|
66
|
+
menu.set_button(1,1, "image1.png", "test1.py")
|
|
67
|
+
menu.set_button(2,1, "subdir/another_image.png", "subdir/another_test.exe", "COM1:" )
|
|
68
|
+
menu.run()
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
See the [examples](https://github.com/mvanriet/happyscript/tree/main/examples/splashmenu) for a demo.
|
|
72
|
+
|
|
@@ -19,7 +19,7 @@ build-backend = "setuptools.build_meta"
|
|
|
19
19
|
|
|
20
20
|
[project]
|
|
21
21
|
name = "happyscript"
|
|
22
|
-
version = "0.0.
|
|
22
|
+
version = "0.0.62"
|
|
23
23
|
description = "GUI framework for running python scripts in a test or production environment"
|
|
24
24
|
authors = [
|
|
25
25
|
{ name="Marc Van Riet" },
|
happyscript-0.0.61/PKG-INFO
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: happyscript
|
|
3
|
-
Version: 0.0.61
|
|
4
|
-
Summary: GUI framework for running python scripts in a test or production environment
|
|
5
|
-
Author: Marc Van Riet
|
|
6
|
-
License-Expression: GPL-3.0-or-later
|
|
7
|
-
Project-URL: Documentation, https://happyscript.readthedocs.io
|
|
8
|
-
Classifier: Development Status :: 4 - Beta
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Natural Language :: English
|
|
12
|
-
Classifier: Topic :: Scientific/Engineering
|
|
13
|
-
Requires-Python: >=3.5
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
Requires-Dist: wxpython
|
|
17
|
-
Dynamic: license-file
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Publish to pypi :
|
|
21
|
-
|
|
22
|
-
- check out the repo
|
|
23
|
-
- make sure the venv is in a python dir ..\venv with all the necessary build requirements
|
|
24
|
-
- run the batch file 'publish.bat'
|
|
25
|
-
- check in the repo with the version number changes
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Writing documentation
|
|
29
|
-
|
|
30
|
-
Use google docstrings :
|
|
31
|
-
https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
|
|
32
|
-
https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html
|
|
33
|
-
|
|
34
|
-
Mkdocs also supports numpy docstrings and sphinx docstrings, but google is easier to read/write.
|
|
35
|
-
|
|
36
|
-
Checking the documentation :
|
|
37
|
-
|
|
38
|
-
- make sure to checkout the github edition in ..\happyscript_github
|
|
39
|
-
- run the python file 'copy_to_github.py'
|
|
40
|
-
|
|
41
|
-
You can see the documentation by running 'mkdocs_serve.bat' in happyscript_github, and then browse to http://127.0.0.1:8000/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
happyscript-0.0.61/README.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Publish to pypi :
|
|
3
|
-
|
|
4
|
-
- check out the repo
|
|
5
|
-
- make sure the venv is in a python dir ..\venv with all the necessary build requirements
|
|
6
|
-
- run the batch file 'publish.bat'
|
|
7
|
-
- check in the repo with the version number changes
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Writing documentation
|
|
11
|
-
|
|
12
|
-
Use google docstrings :
|
|
13
|
-
https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
|
|
14
|
-
https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html
|
|
15
|
-
|
|
16
|
-
Mkdocs also supports numpy docstrings and sphinx docstrings, but google is easier to read/write.
|
|
17
|
-
|
|
18
|
-
Checking the documentation :
|
|
19
|
-
|
|
20
|
-
- make sure to checkout the github edition in ..\happyscript_github
|
|
21
|
-
- run the python file 'copy_to_github.py'
|
|
22
|
-
|
|
23
|
-
You can see the documentation by running 'mkdocs_serve.bat' in happyscript_github, and then browse to http://127.0.0.1:8000/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: happyscript
|
|
3
|
-
Version: 0.0.61
|
|
4
|
-
Summary: GUI framework for running python scripts in a test or production environment
|
|
5
|
-
Author: Marc Van Riet
|
|
6
|
-
License-Expression: GPL-3.0-or-later
|
|
7
|
-
Project-URL: Documentation, https://happyscript.readthedocs.io
|
|
8
|
-
Classifier: Development Status :: 4 - Beta
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Natural Language :: English
|
|
12
|
-
Classifier: Topic :: Scientific/Engineering
|
|
13
|
-
Requires-Python: >=3.5
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
Requires-Dist: wxpython
|
|
17
|
-
Dynamic: license-file
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Publish to pypi :
|
|
21
|
-
|
|
22
|
-
- check out the repo
|
|
23
|
-
- make sure the venv is in a python dir ..\venv with all the necessary build requirements
|
|
24
|
-
- run the batch file 'publish.bat'
|
|
25
|
-
- check in the repo with the version number changes
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Writing documentation
|
|
29
|
-
|
|
30
|
-
Use google docstrings :
|
|
31
|
-
https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
|
|
32
|
-
https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html
|
|
33
|
-
|
|
34
|
-
Mkdocs also supports numpy docstrings and sphinx docstrings, but google is easier to read/write.
|
|
35
|
-
|
|
36
|
-
Checking the documentation :
|
|
37
|
-
|
|
38
|
-
- make sure to checkout the github edition in ..\happyscript_github
|
|
39
|
-
- run the python file 'copy_to_github.py'
|
|
40
|
-
|
|
41
|
-
You can see the documentation by running 'mkdocs_serve.bat' in happyscript_github, and then browse to http://127.0.0.1:8000/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
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
|
|
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
|