hardpy 0.3.0__py3-none-any.whl → 0.5.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.
hardpy/__init__.py CHANGED
@@ -2,8 +2,21 @@
2
2
  # GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
 
4
4
  from hardpy.pytest_hardpy.result import CouchdbLoader
5
- from hardpy.pytest_hardpy.utils import DuplicateSerialNumberError
5
+ from hardpy.pytest_hardpy.utils import (
6
+ DuplicateSerialNumberError,
7
+ DuplicateDialogBoxError,
8
+ )
6
9
  from hardpy.pytest_hardpy.result.couchdb_config import CouchdbConfig
10
+ from hardpy.pytest_hardpy.utils import (
11
+ DialogBox,
12
+ TextInputWidget,
13
+ NumericInputWidget,
14
+ CheckboxWidget,
15
+ RadiobuttonWidget,
16
+ ImageWidget,
17
+ StepWidget,
18
+ MultistepWidget,
19
+ )
7
20
  from hardpy.pytest_hardpy.pytest_call import (
8
21
  get_current_report,
9
22
  set_dut_info,
@@ -14,13 +27,18 @@ from hardpy.pytest_hardpy.pytest_call import (
14
27
  set_run_artifact,
15
28
  set_message,
16
29
  set_driver_info,
30
+ run_dialog_box,
17
31
  )
18
32
 
19
33
  __all__ = [
34
+ # CouchDB
20
35
  "CouchdbLoader",
21
36
  "CouchdbConfig",
22
- "DuplicateSerialNumberError",
23
37
  "get_current_report",
38
+ # Errors
39
+ "DuplicateSerialNumberError",
40
+ "DuplicateDialogBoxError",
41
+ # Database info
24
42
  "set_dut_info",
25
43
  "set_dut_serial_number",
26
44
  "set_stand_info",
@@ -29,4 +47,14 @@ __all__ = [
29
47
  "set_run_artifact",
30
48
  "set_message",
31
49
  "set_driver_info",
50
+ # Dialog boxes
51
+ "run_dialog_box",
52
+ "DialogBox",
53
+ "TextInputWidget",
54
+ "NumericInputWidget",
55
+ "CheckboxWidget",
56
+ "RadiobuttonWidget",
57
+ "ImageWidget",
58
+ "StepWidget",
59
+ "MultistepWidget",
32
60
  ]
@@ -64,6 +64,21 @@ def couch_connection():
64
64
  }
65
65
 
66
66
 
67
+ @app.post("/api/confirm_dialog_box/{dialog_box_output}")
68
+ def confirm_dialog_box(dialog_box_output: str):
69
+ """Confirm dialog box.
70
+
71
+ Args:
72
+ dialog_box_output (str): output data from dialog box.
73
+
74
+ Returns:
75
+ dict[str, RunStatus]: run status
76
+ """
77
+ if app.state.pytest_wrp.confirm_dialog_box(dialog_box_output):
78
+ return {"status": Status.BUSY}
79
+ return {"status": Status.ERROR}
80
+
81
+
67
82
  app.mount(
68
83
  "/",
69
84
  StaticFiles(directory=(os.path.dirname(__file__)) + "/frontend/dist", html=True),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "/static/css/main.e8a862f1.css",
4
- "main.js": "/static/js/main.8ef63e9b.js",
4
+ "main.js": "/static/js/main.da686f40.js",
5
5
  "blueprint-icons-all-paths-loader.js": "/static/js/blueprint-icons-all-paths-loader.0aa89747.chunk.js",
6
6
  "blueprint-icons-split-paths-by-size-loader.js": "/static/js/blueprint-icons-split-paths-by-size-loader.52a072d3.chunk.js",
7
7
  "static/js/808.ce070002.chunk.js": "/static/js/808.ce070002.chunk.js",
@@ -21,7 +21,7 @@
21
21
  "static/media/logo_smol.png": "/static/media/logo_smol.5b16f92447a4a9e80331.png",
22
22
  "index.html": "/index.html",
23
23
  "main.e8a862f1.css.map": "/static/css/main.e8a862f1.css.map",
24
- "main.8ef63e9b.js.map": "/static/js/main.8ef63e9b.js.map",
24
+ "main.da686f40.js.map": "/static/js/main.da686f40.js.map",
25
25
  "blueprint-icons-all-paths-loader.0aa89747.chunk.js.map": "/static/js/blueprint-icons-all-paths-loader.0aa89747.chunk.js.map",
26
26
  "blueprint-icons-split-paths-by-size-loader.52a072d3.chunk.js.map": "/static/js/blueprint-icons-split-paths-by-size-loader.52a072d3.chunk.js.map",
27
27
  "808.ce070002.chunk.js.map": "/static/js/808.ce070002.chunk.js.map",
@@ -31,6 +31,6 @@
31
31
  },
32
32
  "entrypoints": [
33
33
  "static/css/main.e8a862f1.css",
34
- "static/js/main.8ef63e9b.js"
34
+ "static/js/main.da686f40.js"
35
35
  ]
36
36
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>HardPy Operator Panel</title><script defer="defer" src="/static/js/main.8ef63e9b.js"></script><link href="/static/css/main.e8a862f1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>HardPy Operator Panel</title><script defer="defer" src="/static/js/main.da686f40.js"></script><link href="/static/css/main.e8a862f1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>