hardpy 0.15.2__py3-none-any.whl → 0.17.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 (64) hide show
  1. hardpy/__init__.py +9 -6
  2. hardpy/cli/cli.py +16 -10
  3. hardpy/cli/template.py +5 -4
  4. hardpy/common/config.py +83 -50
  5. hardpy/{pytest_hardpy/utils → common}/singleton.py +1 -1
  6. hardpy/hardpy_panel/api.py +44 -13
  7. hardpy/hardpy_panel/frontend/dist/assets/{allPaths-CV5wjLMB.js → allPaths-COgYwK8M.js} +1 -1
  8. hardpy/hardpy_panel/frontend/dist/assets/{allPathsLoader-JIzW_pSb.js → allPathsLoader-B8vBKA-e.js} +2 -2
  9. hardpy/hardpy_panel/frontend/dist/assets/{blueprint-icons-16-Bfs1BwbR.ttf → blueprint-icons-16-B2twAPZE.ttf} +0 -0
  10. hardpy/hardpy_panel/frontend/dist/assets/{blueprint-icons-16-RCDSkC4W.eot → blueprint-icons-16-C0Unyq1d.eot} +0 -0
  11. hardpy/hardpy_panel/frontend/dist/assets/{blueprint-icons-16-CzsyEoPG.svg → blueprint-icons-16-CVy9qFng.svg} +249 -3
  12. hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-Ck1ifK4A.woff +0 -0
  13. hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-DwWyHYRo.woff2 +0 -0
  14. hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-9zitLjlL.woff2 +0 -0
  15. hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-CjKGIKxE.woff +0 -0
  16. hardpy/hardpy_panel/frontend/dist/assets/{blueprint-icons-20-DyVnGNfQ.svg → blueprint-icons-20-DQ09GSQq.svg} +249 -3
  17. hardpy/hardpy_panel/frontend/dist/assets/{blueprint-icons-20-BGGGsqDJ.ttf → blueprint-icons-20-DmR755bS.ttf} +0 -0
  18. hardpy/hardpy_panel/frontend/dist/assets/{blueprint-icons-20-Doom1bSH.eot → blueprint-icons-20-p9MhBXD8.eot} +0 -0
  19. hardpy/hardpy_panel/frontend/dist/assets/browser-ponyfill-CVrkrold.js +2 -0
  20. hardpy/hardpy_panel/frontend/dist/assets/index-B-fsa5Ru.js +1 -0
  21. hardpy/hardpy_panel/frontend/dist/assets/index-B3wEgxl0.js +4673 -0
  22. hardpy/hardpy_panel/frontend/dist/assets/index-B7T9xvaW.css +1 -0
  23. hardpy/hardpy_panel/frontend/dist/assets/index-DLOviMB1.js +1 -0
  24. hardpy/hardpy_panel/frontend/dist/assets/{splitPathsBySizeLoader-DkZadBcn.js → splitPathsBySizeLoader-CLCw9W9y.js} +1 -1
  25. hardpy/hardpy_panel/frontend/dist/index.html +2 -2
  26. hardpy/hardpy_panel/frontend/dist/locales/de/translation.json +22 -7
  27. hardpy/hardpy_panel/frontend/dist/locales/en/translation.json +22 -7
  28. hardpy/hardpy_panel/frontend/dist/locales/es/translation.json +22 -7
  29. hardpy/hardpy_panel/frontend/dist/locales/fr/translation.json +22 -7
  30. hardpy/hardpy_panel/frontend/dist/locales/ja/translation.json +16 -1
  31. hardpy/hardpy_panel/frontend/dist/locales/ru/translation.json +22 -7
  32. hardpy/hardpy_panel/frontend/dist/locales/zh/translation.json +16 -1
  33. hardpy/pytest_hardpy/db/__init__.py +12 -0
  34. hardpy/pytest_hardpy/db/base_store.py +31 -4
  35. hardpy/pytest_hardpy/db/runstore.py +1 -1
  36. hardpy/pytest_hardpy/db/schema/v1.py +8 -6
  37. hardpy/pytest_hardpy/db/statestore.py +1 -1
  38. hardpy/pytest_hardpy/plugin.py +38 -25
  39. hardpy/pytest_hardpy/pytest_call.py +74 -29
  40. hardpy/pytest_hardpy/pytest_wrapper.py +9 -7
  41. hardpy/pytest_hardpy/reporter/base.py +21 -1
  42. hardpy/pytest_hardpy/reporter/runner_reporter.py +1 -1
  43. hardpy/pytest_hardpy/result/report_loader/stand_cloud_loader.py +35 -4
  44. hardpy/pytest_hardpy/utils/__init__.py +0 -16
  45. hardpy/pytest_hardpy/utils/dialog_box.py +3 -0
  46. {hardpy-0.15.2.dist-info → hardpy-0.17.0.dist-info}/METADATA +17 -2
  47. hardpy-0.17.0.dist-info/RECORD +83 -0
  48. hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-Btb8d-Hu.woff +0 -0
  49. hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-DrH54W_x.woff2 +0 -0
  50. hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-D9WO2FSG.woff2 +0 -0
  51. hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-ZW-9JnPf.woff +0 -0
  52. hardpy/hardpy_panel/frontend/dist/assets/browser-ponyfill-CccdstaD.js +0 -2
  53. hardpy/hardpy_panel/frontend/dist/assets/index-6RIgWzcZ.js +0 -790
  54. hardpy/hardpy_panel/frontend/dist/assets/index-BMEat_ws.js +0 -1
  55. hardpy/hardpy_panel/frontend/dist/assets/index-BwCQzehg.css +0 -1
  56. hardpy/hardpy_panel/frontend/dist/assets/index-xb4M2ucX.js +0 -1
  57. hardpy/pytest_hardpy/db/base_connector.py +0 -31
  58. hardpy/pytest_hardpy/db/base_server.py +0 -14
  59. hardpy/pytest_hardpy/utils/connection_data.py +0 -13
  60. hardpy-0.15.2.dist-info/RECORD +0 -86
  61. /hardpy/pytest_hardpy/{utils → db}/stand_type.py +0 -0
  62. {hardpy-0.15.2.dist-info → hardpy-0.17.0.dist-info}/WHEEL +0 -0
  63. {hardpy-0.15.2.dist-info → hardpy-0.17.0.dist-info}/entry_points.txt +0 -0
  64. {hardpy-0.15.2.dist-info → hardpy-0.17.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,7 +1,8 @@
1
- # Copyright (c) 2024 Everypin
1
+ # Copyright (c) 2025 Everypin
2
2
  # GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
  from __future__ import annotations
4
4
 
5
+ import json
5
6
  from dataclasses import dataclass
6
7
  from inspect import stack
7
8
  from os import environ
@@ -9,25 +10,21 @@ from time import sleep
9
10
  from typing import TYPE_CHECKING, Any
10
11
  from uuid import uuid4
11
12
 
12
- from pycouchdb.exceptions import NotFound
13
- from pydantic import ValidationError
14
-
15
13
  from hardpy.pytest_hardpy.db import (
14
+ Chart,
16
15
  DatabaseField as DF, # noqa: N817
16
+ Instrument,
17
+ NumericMeasurement,
17
18
  ResultRunStore,
18
- RunStore,
19
+ StringMeasurement,
20
+ SubUnit,
19
21
  )
20
22
  from hardpy.pytest_hardpy.reporter import RunnerReporter
21
23
  from hardpy.pytest_hardpy.utils import (
22
- Chart,
23
24
  DialogBox,
24
25
  DuplicateParameterError,
25
26
  HTMLComponent,
26
27
  ImageComponent,
27
- Instrument,
28
- NumericMeasurement,
29
- StringMeasurement,
30
- SubUnit,
31
28
  TestStandNumberError,
32
29
  )
33
30
 
@@ -43,6 +40,23 @@ class CurrentTestInfo:
43
40
  case_id: str
44
41
 
45
42
 
43
+ @dataclass
44
+ class PassFailDialog:
45
+ """Result of dialog box interaction.
46
+
47
+ Attributes:
48
+ result: True if the dialog was successful
49
+ data: Data from widget if any, None otherwise
50
+ """
51
+
52
+ result: bool = False
53
+ data: Any = None
54
+
55
+ def __bool__(self) -> bool:
56
+ """Return True if the dialog was successful."""
57
+ return self.result
58
+
59
+
46
60
  class ErrorCode:
47
61
  """Save error code and return error message.
48
62
 
@@ -71,7 +85,7 @@ class ErrorCode:
71
85
  if reporter.get_field(key) is None:
72
86
  reporter.set_doc_value(key, code)
73
87
  reporter.update_db_by_doc()
74
- self._message = message
88
+ self._message = message if message else f"Error code = {code}"
75
89
 
76
90
  def __repr__(self) -> str:
77
91
  return self._message
@@ -86,15 +100,8 @@ def get_current_report() -> ResultRunStore | None:
86
100
  Returns:
87
101
  ResultRunStore | None: report, or None if not found or invalid
88
102
  """
89
- runstore = RunStore()
90
- try:
91
- return runstore.get_document() # type: ignore
92
- except NotFound:
93
- return None
94
- except ValidationError:
95
- return None
96
- except TypeError:
97
- return None
103
+ reporter = RunnerReporter()
104
+ return reporter.get_report()
98
105
 
99
106
 
100
107
  def set_user_name(name: str) -> None:
@@ -154,7 +161,7 @@ def set_dut_sub_unit(sub_unit: SubUnit) -> int:
154
161
  return len(sub_units) - 1
155
162
 
156
163
 
157
- def set_dut_info(info: Mapping[str, str | int | float]) -> None:
164
+ def set_dut_info(info: Mapping[str, str | int | float | None]) -> None:
158
165
  """Set DUT info to document.
159
166
 
160
167
  Args:
@@ -278,7 +285,7 @@ def set_stand_name(name: str) -> None:
278
285
  reporter.update_db_by_doc()
279
286
 
280
287
 
281
- def set_stand_info(info: Mapping[str, str | int | float]) -> None:
288
+ def set_stand_info(info: Mapping[str, str | int | float | None]) -> None:
282
289
  """Add test stand info to document.
283
290
 
284
291
  Args:
@@ -524,7 +531,7 @@ def set_process_number(number: int) -> None:
524
531
  reporter.update_db_by_doc()
525
532
 
526
533
 
527
- def set_process_info(info: Mapping[str, str | int | float]) -> None:
534
+ def set_process_info(info: Mapping[str, str | int | float | None]) -> None:
528
535
  """Set process info to document.
529
536
 
530
537
  Args:
@@ -603,7 +610,6 @@ def run_dialog_box(dialog_box_data: DialogBox) -> Any: # noqa: ANN401
603
610
  dialog_box_data (DialogBox): Data for creating the dialog box.
604
611
 
605
612
  DialogBox attributes:
606
-
607
613
  - dialog_text (str): The text of the dialog box.
608
614
  - title_bar (str | None): The title bar of the dialog box.
609
615
  If the title_bar field is missing, it is the case name.
@@ -613,22 +619,22 @@ def run_dialog_box(dialog_box_data: DialogBox) -> Any: # noqa: ANN401
613
619
 
614
620
  Returns:
615
621
  Any: An object containing the user's response.
616
-
617
622
  The type of the return value depends on the widget type:
618
-
619
623
  - BASE: bool.
620
624
  - TEXT_INPUT: str.
621
625
  - NUMERIC_INPUT: float.
622
626
  - RADIOBUTTON: str.
623
627
  - CHECKBOX: list[str].
624
628
  - MULTISTEP: bool.
629
+ - Pass/Fail widget: PassFailDialog.
625
630
 
626
631
  Raises:
627
- ValueError: If the 'message' argument is empty.
632
+ ValueError: If the 'dialog_text' argument is empty.
628
633
  """
629
634
  if not dialog_box_data.dialog_text:
630
635
  msg = "The 'dialog_text' argument cannot be empty."
631
636
  raise ValueError(msg)
637
+
632
638
  reporter = RunnerReporter()
633
639
  current_test = _get_current_test()
634
640
  key = reporter.generate_key(
@@ -644,9 +650,17 @@ def run_dialog_box(dialog_box_data: DialogBox) -> Any: # noqa: ANN401
644
650
  reporter.update_db_by_doc()
645
651
 
646
652
  input_dbx_data = _get_operator_data()
647
-
648
653
  _cleanup_widget(reporter, key)
649
- return dialog_box_data.widget.convert_data(input_dbx_data)
654
+
655
+ if dialog_box_data.pass_fail:
656
+ return _process_pass_fail_dialog(dialog_box_data, input_dbx_data)
657
+
658
+ try:
659
+ data_dict = json.loads(input_dbx_data)
660
+ except json.JSONDecodeError:
661
+ return dialog_box_data.widget.convert_data(input_dbx_data)
662
+ widget_data = data_dict.get("data", "")
663
+ return dialog_box_data.widget.convert_data(widget_data)
650
664
 
651
665
 
652
666
  def set_operator_message( # noqa: PLR0913
@@ -734,6 +748,7 @@ def _get_current_test() -> CurrentTestInfo:
734
748
  caller = stack()[1].function
735
749
  msg = f"Function {caller} can't be called outside of the test."
736
750
  reporter.set_alert(msg)
751
+ reporter.update_db_by_doc()
737
752
  raise RuntimeError(msg)
738
753
 
739
754
  module_delimiter = ".py::"
@@ -777,3 +792,33 @@ def _get_operator_data() -> str:
777
792
  def _cleanup_widget(reporter: RunnerReporter, key: str) -> None:
778
793
  reporter.set_doc_value(key, {}, statestore_only=True)
779
794
  reporter.update_db_by_doc()
795
+
796
+
797
+ def _process_pass_fail_dialog(
798
+ dialog_box_data: DialogBox,
799
+ input_data: str,
800
+ ) -> PassFailDialog:
801
+ """Process pass/fail dialog result."""
802
+ result = PassFailDialog()
803
+
804
+ try:
805
+ data_dict = json.loads(input_data)
806
+ except json.JSONDecodeError:
807
+ result.result = False
808
+ if dialog_box_data.widget:
809
+ result.data = dialog_box_data.widget.convert_data(input_data)
810
+ else:
811
+ result.data = True
812
+ return result
813
+
814
+ result_value = data_dict.get("result", "")
815
+ widget_data = data_dict.get("data", "")
816
+
817
+ result.result = result_value == "passed"
818
+
819
+ if dialog_box_data.widget and widget_data:
820
+ result.data = dialog_box_data.widget.convert_data(widget_data)
821
+ else:
822
+ result.data = True
823
+
824
+ return result
@@ -22,7 +22,8 @@ class PyTestWrapper:
22
22
 
23
23
  # Make sure test structure is stored in DB
24
24
  # before clients come in
25
- self.config = ConfigManager().get_config()
25
+ self._config_manager = ConfigManager()
26
+ self.config = self._config_manager.config
26
27
  self.collect(is_clear_database=True)
27
28
 
28
29
  def start(self, start_args: dict | None = None) -> bool:
@@ -42,7 +43,7 @@ class PyTestWrapper:
42
43
  "-m",
43
44
  "pytest",
44
45
  "--hardpy-db-url",
45
- self.config.database.connection_url(),
46
+ self.config.database.url,
46
47
  "--hardpy-tests-name",
47
48
  self.config.tests_name,
48
49
  "--sc-address",
@@ -59,13 +60,13 @@ class PyTestWrapper:
59
60
  if system() == "Windows":
60
61
  self._proc = subprocess.Popen( # noqa: S603
61
62
  cmd,
62
- cwd=ConfigManager().get_tests_path(),
63
+ cwd=self._config_manager.tests_path,
63
64
  creationflags=subprocess.CREATE_NEW_PROCESS_GROUP,
64
65
  )
65
66
  if system() == "Linux":
66
67
  self._proc = subprocess.Popen( # noqa: S603
67
68
  cmd,
68
- cwd=ConfigManager().get_tests_path(),
69
+ cwd=self._config_manager.tests_path,
69
70
  )
70
71
 
71
72
  return True
@@ -105,7 +106,7 @@ class PyTestWrapper:
105
106
  "pytest",
106
107
  "--collect-only",
107
108
  "--hardpy-db-url",
108
- self.config.database.connection_url(),
109
+ self.config.database.url,
109
110
  "--hardpy-tests-name",
110
111
  self.config.tests_name,
111
112
  "--hardpy-pt",
@@ -116,7 +117,7 @@ class PyTestWrapper:
116
117
 
117
118
  subprocess.Popen( # noqa: S603
118
119
  [self.python_executable, *args],
119
- cwd=ConfigManager().get_tests_path(),
120
+ cwd=self._config_manager.tests_path,
120
121
  )
121
122
  return True
122
123
 
@@ -153,4 +154,5 @@ class PyTestWrapper:
153
154
  Returns:
154
155
  dict: HardPy configuration
155
156
  """
156
- return ConfigManager().get_config().model_dump()
157
+ config_manager = ConfigManager()
158
+ return config_manager.config.model_dump()
@@ -1,11 +1,16 @@
1
- # Copyright (c) 2024 Everypin
1
+ # Copyright (c) 2025 Everypin
2
2
  # GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3
+ from __future__ import annotations
3
4
 
4
5
  from logging import getLogger
5
6
  from typing import Any
6
7
 
8
+ from pycouchdb.exceptions import NotFound
9
+ from pydantic import ValidationError
10
+
7
11
  from hardpy.pytest_hardpy.db import (
8
12
  DatabaseField as DF, # noqa: N817
13
+ ResultRunStore,
9
14
  RunStore,
10
15
  StateStore,
11
16
  )
@@ -82,6 +87,21 @@ class BaseReporter:
82
87
  """
83
88
  return ".".join(args)
84
89
 
90
+ def get_report(self) -> ResultRunStore | None:
91
+ """Get current report from runstore database.
92
+
93
+ Returns:
94
+ ResultRunStore | None: report, or None if not found or invalid
95
+ """
96
+ try:
97
+ return self._runstore.get_document() # type: ignore
98
+ except NotFound:
99
+ return None
100
+ except ValidationError:
101
+ return None
102
+ except TypeError:
103
+ return None
104
+
85
105
  def get_current_attempt(self, module_id: str, case_id: str) -> int:
86
106
  """Get current attempt.
87
107
 
@@ -4,8 +4,8 @@
4
4
  from logging import getLogger
5
5
  from typing import Any
6
6
 
7
+ from hardpy.common.singleton import SingletonMeta
7
8
  from hardpy.pytest_hardpy.reporter.base import BaseReporter
8
- from hardpy.pytest_hardpy.utils import SingletonMeta
9
9
 
10
10
 
11
11
  class RunnerReporter(BaseReporter, metaclass=SingletonMeta):
@@ -7,8 +7,8 @@ from typing import TYPE_CHECKING
7
7
  from oauthlib.oauth2.rfc6749.errors import OAuth2Error
8
8
  from requests.exceptions import HTTPError
9
9
 
10
+ from hardpy.common.config import ConfigManager
10
11
  from hardpy.common.stand_cloud.connector import StandCloudConnector, StandCloudError
11
- from hardpy.pytest_hardpy.utils import ConnectionData
12
12
 
13
13
  if TYPE_CHECKING:
14
14
  from requests import Response
@@ -28,8 +28,8 @@ class StandCloudLoader:
28
28
  Can be used outside of HardPy applications.
29
29
  """
30
30
  self._verify_ssl = not __debug__
31
- connection_data = ConnectionData()
32
- sc_addr = address if address else connection_data.sc_address
31
+ config_manager = ConfigManager()
32
+ sc_addr = address if address else config_manager.config.stand_cloud.address
33
33
  self._sc_connector = StandCloudConnector(sc_addr)
34
34
 
35
35
  def load(self, report: ResultRunStore, timeout: int = 20) -> Response:
@@ -47,11 +47,12 @@ class StandCloudLoader:
47
47
  StandCloudError: if report not uploaded to StandCloud
48
48
  """
49
49
  api = self._sc_connector.get_api("test_report")
50
+ sc_report = self._convert_to_sc_format(report)
50
51
 
51
52
  try:
52
53
  resp = api.post(
53
54
  verify=self._verify_ssl,
54
- json=report.model_dump(),
55
+ json=sc_report.model_dump(),
55
56
  timeout=timeout,
56
57
  )
57
58
  except RuntimeError as exc:
@@ -73,3 +74,33 @@ class StandCloudLoader:
73
74
  StandCloudError: if StandCloud is unavailable
74
75
  """
75
76
  return self._sc_connector.healthcheck()
77
+
78
+ def _convert_to_sc_format(self, report: ResultRunStore) -> ResultRunStore:
79
+ """Convert report to StandCloud format.
80
+
81
+ StandCloud expects parameters to be not empty.
82
+ If a parameter is None, it will be replaced with "unknown".
83
+ """
84
+ unknown_param = "unknown"
85
+ # test stand name
86
+ if not report.test_stand.name:
87
+ report.test_stand.name = unknown_param
88
+ # DUT part number
89
+ if not report.dut.part_number:
90
+ report.dut.part_number = unknown_param
91
+ # DUT name
92
+ if not report.dut.name:
93
+ report.dut.name = report.dut.part_number
94
+ # sub unit part number and name
95
+ for sub_unit in report.dut.sub_units:
96
+ if not sub_unit.part_number:
97
+ sub_unit.part_number = unknown_param
98
+ if not sub_unit.name:
99
+ sub_unit.name = sub_unit.part_number
100
+ # instrument part number and name
101
+ for instrument in report.test_stand.instruments:
102
+ if not instrument.part_number:
103
+ instrument.part_number = unknown_param
104
+ if not instrument.name:
105
+ instrument.name = instrument.part_number
106
+ return report
@@ -1,7 +1,6 @@
1
1
  # Copyright (c) 2024 Everypin
2
2
  # GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
 
4
- from hardpy.pytest_hardpy.utils.connection_data import ConnectionData
5
4
  from hardpy.pytest_hardpy.utils.const import (
6
5
  ChartType,
7
6
  ComparisonOperation,
@@ -30,40 +29,25 @@ from hardpy.pytest_hardpy.utils.exception import (
30
29
  from hardpy.pytest_hardpy.utils.machineid import machine_id
31
30
  from hardpy.pytest_hardpy.utils.node_info import NodeInfo
32
31
  from hardpy.pytest_hardpy.utils.progress_calculator import ProgressCalculator
33
- from hardpy.pytest_hardpy.utils.singleton import SingletonMeta
34
- from hardpy.pytest_hardpy.utils.stand_type import (
35
- Chart,
36
- Instrument,
37
- NumericMeasurement,
38
- StringMeasurement,
39
- SubUnit,
40
- )
41
32
 
42
33
  __all__ = [
43
34
  "BaseWidget",
44
- "Chart",
45
35
  "ChartType",
46
36
  "CheckboxWidget",
47
37
  "ComparisonOperation",
48
- "ConnectionData",
49
38
  "DialogBox",
50
39
  "DuplicateParameterError",
51
40
  "Group",
52
41
  "HTMLComponent",
53
42
  "ImageComponent",
54
43
  "ImageError",
55
- "Instrument",
56
44
  "MeasurementType",
57
45
  "MultistepWidget",
58
46
  "NodeInfo",
59
47
  "NumericInputWidget",
60
- "NumericMeasurement",
61
48
  "ProgressCalculator",
62
49
  "RadiobuttonWidget",
63
- "SingletonMeta",
64
50
  "StepWidget",
65
- "StringMeasurement",
66
- "SubUnit",
67
51
  "TestStandNumberError",
68
52
  "TestStatus",
69
53
  "TextInputWidget",
@@ -366,6 +366,7 @@ class DialogBox:
366
366
  widget (IWidget | None): widget info
367
367
  image (ImageComponent | None): image
368
368
  font_size (int): font size
369
+ pass_fail (bool): enable pass/fail buttons instead of confirm button
369
370
  """
370
371
 
371
372
  def __init__( # noqa: PLR0913
@@ -376,6 +377,7 @@ class DialogBox:
376
377
  image: ImageComponent | None = None,
377
378
  html: HTMLComponent | None = None,
378
379
  font_size: int = 14,
380
+ pass_fail: bool = False,
379
381
  ) -> None:
380
382
  self.widget: IWidget = BaseWidget() if widget is None else widget
381
383
  self.image: ImageComponent | None = image
@@ -385,6 +387,7 @@ class DialogBox:
385
387
  self.visible: bool = True
386
388
  self.id = str(uuid4())
387
389
  self.font_size = font_size
390
+ self.pass_fail: bool = pass_fail
388
391
 
389
392
  if font_size < 1:
390
393
  msg = "The 'font_size' argument cannot be less than 1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hardpy
3
- Version: 0.15.2
3
+ Version: 0.17.0
4
4
  Summary: HardPy library for device testing
5
5
  Project-URL: Homepage, https://github.com/everypinio/hardpy/
6
6
  Project-URL: Documentation, https://everypinio.github.io/hardpy/
@@ -68,6 +68,8 @@ HardPy is a python library for creating a test bench for devices.
68
68
  ![python versions](https://img.shields.io/pypi/pyversions/hardpy.svg)
69
69
  [![pytest versions](https://img.shields.io/badge/pytest-%3E%3D7.0%20%3C9.0-blue)](https://docs.pytest.org/en/latest/)
70
70
  [![Documentation](https://img.shields.io/badge/Documentation%20-Overview%20-%20%23007ec6)](https://everypinio.github.io/hardpy/)
71
+ [![Reddit](https://img.shields.io/badge/-Reddit-FF4500?style=flat&logo=reddit&logoColor=white)](https://www.reddit.com/r/HardPy)
72
+ [![Telegram](https://img.shields.io/badge/-Telegram-2CA5E0?style=flat&logo=telegram&logoColor=white)](https://t.me/everypin)
71
73
 
72
74
  </div>
73
75
 
@@ -109,8 +111,21 @@ hardpy run
109
111
  4. View operator panel in browser: http://localhost:8000/
110
112
  5. View the latest test report: http://localhost:5984/_utils
111
113
 
112
- Login and password: **dev**, database - **runstore**, document - **current**.
114
+ Login and password: **dev**, database - **runstore**.
113
115
 
114
116
  ## Examples
115
117
 
116
118
  For more examples of using **HardPy**, see the [examples](https://github.com/everypinio/hardpy/tree/main/examples) folder and the [documentation](https://everypinio.github.io/hardpy/examples/).
119
+
120
+ ## Measurement instruments
121
+
122
+ **HardPy** does not contain any drivers for interacting with measuring equipment.
123
+ However, **HardPy** allows you to work with any Python code, meaning you can use
124
+ open libraries to interact with measuring equipment.
125
+
126
+ * [InstrumentKit](https://github.com/instrumentkit/InstrumentKit)
127
+ * [Instrumental](https://github.com/mabuchilab/Instrumental)
128
+ * [PyMeasure](https://github.com/pymeasure/pymeasure)
129
+ * [PyTango](https://gitlab.com/tango-controls/pytango)
130
+ * [QCoDeS](https://github.com/microsoft/Qcodes)
131
+ * [QCoDeS contrib drivers](https://github.com/QCoDeS/Qcodes_contrib_drivers)
@@ -0,0 +1,83 @@
1
+ hardpy/__init__.py,sha256=B99MElYhd8HHgOJaT-RVPyvIN18uPaG2pb78TJ3lqvE,2957
2
+ hardpy/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ hardpy/cli/cli.py,sha256=MmVup0jt_H0erPiqloPInbiZ9SjWHmJvqewHOtlqB10,9632
4
+ hardpy/cli/template.py,sha256=kOl8hsj6iBTFIDUli_dzHkH8mlnoJzOlr9muLpTEayg,6230
5
+ hardpy/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ hardpy/common/config.py,sha256=XstzgQVOSgGz44_OH82jjxM90ZTI97odp-juICfx2h0,6289
7
+ hardpy/common/singleton.py,sha256=RVMqbluN-mhlJ4QOYcRzQLA68Hs8t83XNyihyUwhYGo,948
8
+ hardpy/common/stand_cloud/__init__.py,sha256=fezdiYAehtT2H-GAef-xZU12CbmCRe64XHA9UB3kJDU,456
9
+ hardpy/common/stand_cloud/connector.py,sha256=scmKT09duPqqbQtwMNPnl59si_sErwqAY2PeiTSCZvg,7389
10
+ hardpy/common/stand_cloud/exception.py,sha256=eKkqu5ylDRIGN_yZhvz2xVGm49XmlZ8nryALgdRqpbY,287
11
+ hardpy/common/stand_cloud/oauth2.py,sha256=SDqtIwcuMgqfBkEZyo3GXeVPnvRBOr6dzeXowx3ZkEw,2803
12
+ hardpy/common/stand_cloud/registration.py,sha256=UW-JGcvON5CMQQ-s2Mb4Ee3u_jmdQfSj3vPfZ_FuhHY,2370
13
+ hardpy/common/stand_cloud/token_manager.py,sha256=8dX802F0CnOrOjOQInyYCrvuRdK0CeiCrTDITAbSLgQ,4055
14
+ hardpy/common/stand_cloud/utils.py,sha256=GN3wzbrmF-Xe5iUXf_HurGO-YKltqd3Gc_7vG2eEL7c,692
15
+ hardpy/hardpy_panel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ hardpy/hardpy_panel/api.py,sha256=iO7zBH56X74mj1c_5NudRlQ7frnBu-fXAoRfpN_2jU8,4721
17
+ hardpy/hardpy_panel/frontend/dist/favicon.ico,sha256=sgIk5PKUKEKBDpkSrc8dJgjpObp0iF82Mec0GpfKId4,15406
18
+ hardpy/hardpy_panel/frontend/dist/index.html,sha256=TuDSiAa1VbLgrz1_EYKJ5gbq4vCWhE6PLWy-5WLztmU,1851
19
+ hardpy/hardpy_panel/frontend/dist/logo192.png,sha256=E4K7drvhJCg9HcTpRihOXZhVJVBZ7-W97Se-3tDb46o,14485
20
+ hardpy/hardpy_panel/frontend/dist/logo512.png,sha256=-fIMbqX7PYUpheK4kX1C1erRTe_hHZwFQYDLrAbhFRU,34188
21
+ hardpy/hardpy_panel/frontend/dist/manifest.json,sha256=PfmJlN2JMJtHS6OnhU4b4X5wPQC_yRBdjesjoirObSA,502
22
+ hardpy/hardpy_panel/frontend/dist/assets/allPaths-COgYwK8M.js,sha256=2JkMqs8xPIr8ItLpkMgBWHySJ8p5TUbsFrYr_-E7xPQ,309
23
+ hardpy/hardpy_panel/frontend/dist/assets/allPathsLoader-B8vBKA-e.js,sha256=YCgReluxLYNHZhpvLDzOy50NssDFpeJVwm0kr7qe1Ks,550
24
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-B2twAPZE.ttf,sha256=OcrUHPBAaLvJxb2DOethXFXg8PClDcyvpsh0mToLFPM,136248
25
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-C0Unyq1d.eot,sha256=Bl93LjY8pyBj0Iip1lUxMM-0l1zLrRjoGmKPPnAQIgw,136456
26
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-CVy9qFng.svg,sha256=57jlcc-NFRVJNJ3t-1fOnJvgdbYhcrF5a06LJLhWc5A,601027
27
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-Ck1ifK4A.woff,sha256=9W-hM1YPeHLTGLjDz7hd9mBs0nXNg99kjlXIRS7iZaE,61520
28
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-16-DwWyHYRo.woff2,sha256=3DtNkaNmO1RXcLJx-eja1bxqA3R7chUihisW0Z-kfu4,47912
29
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-9zitLjlL.woff2,sha256=4jgQ8HcAfHcmzwcanf_BPt1B3dTyZL20PyB2gz2l0LQ,49336
30
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-CjKGIKxE.woff,sha256=VD9bOsCtbHvvPSDgIZpPlMiCuoUWPXMJ411s9fY4CQ4,63676
31
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-DQ09GSQq.svg,sha256=3gLRYNxd_Y4iz6pspH4Bf7Ql4F6LH5haZzbTfxA53HQ,638634
32
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-DmR755bS.ttf,sha256=yr5g5Jw9ZnxJJ7e1quOv977VE3NU2GRB60BMRrOJrcI,139424
33
+ hardpy/hardpy_panel/frontend/dist/assets/blueprint-icons-20-p9MhBXD8.eot,sha256=CFx8t8ONhB4INIrK860N56_t1dmS7FuRF7i0HKKo58k,139632
34
+ hardpy/hardpy_panel/frontend/dist/assets/browser-ponyfill-CVrkrold.js,sha256=vUSCWEs44pq-5JcVpxtnzyXKkZAOzF6e_MtKQRYcdW4,10294
35
+ hardpy/hardpy_panel/frontend/dist/assets/index-B-fsa5Ru.js,sha256=IonL7d7ppdDr-_FRJZQPWI4HHFTiygYvZGVlUxHY9R8,294235
36
+ hardpy/hardpy_panel/frontend/dist/assets/index-B3wEgxl0.js,sha256=-a8qldezMp9j9dIpHX0R36t44Uw0TlpV_BMFZBknW5A,5949987
37
+ hardpy/hardpy_panel/frontend/dist/assets/index-B7T9xvaW.css,sha256=5m7QXWbthqi_Va8qlvnTZeuRzSN_ZJUdhyeb3JD6ZME,315862
38
+ hardpy/hardpy_panel/frontend/dist/assets/index-DLOviMB1.js,sha256=sI0W1vvwqvIwKP2_jglrwOhej3n5rJD72-d4ZhlUHqM,285612
39
+ hardpy/hardpy_panel/frontend/dist/assets/logo_smol-CK3jE85c.png,sha256=E4K7drvhJCg9HcTpRihOXZhVJVBZ7-W97Se-3tDb46o,14485
40
+ hardpy/hardpy_panel/frontend/dist/assets/splitPathsBySizeLoader-CLCw9W9y.js,sha256=i_Ss0rp4pmd3ZqqDqBGoO3xQt7Ckm31HfpXPF27B4s4,472
41
+ hardpy/hardpy_panel/frontend/dist/locales/de/translation.json,sha256=vYVYRpSrpGZi7s8tPoAZxtVCeuPqhlwK1qC_lm52Pzc,2575
42
+ hardpy/hardpy_panel/frontend/dist/locales/en/translation.json,sha256=jJ1DEY6-fx--a5VQW6SOYCvPLQXfizs-JtsRf1rohiI,2333
43
+ hardpy/hardpy_panel/frontend/dist/locales/es/translation.json,sha256=_biD1ve2CpvFDeRO7dzoFyvbeFcz-572UzhUzn002Z8,2628
44
+ hardpy/hardpy_panel/frontend/dist/locales/fr/translation.json,sha256=YC8aL1tDx8LjmfC2pjfJ_rjl_mSDGnUIxCa80ZqxLus,2635
45
+ hardpy/hardpy_panel/frontend/dist/locales/ja/translation.json,sha256=kGBJmHlhnduRPLOIoSU1UoRy5RfJURGdg1YckIchA9w,2845
46
+ hardpy/hardpy_panel/frontend/dist/locales/ru/translation.json,sha256=81pqFajGhSwPwZV4j0HpziB1oX2iJ5Ud12cLiAaX8J0,3467
47
+ hardpy/hardpy_panel/frontend/dist/locales/zh/translation.json,sha256=9W61N2MA15J5Zj6UqBqPmUDZXaRAH2HWm9m51BgvzJw,2322
48
+ hardpy/pytest_hardpy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
+ hardpy/pytest_hardpy/plugin.py,sha256=Qa_TaNjvDARlQoINxca4_3b3sS58V0CiJdV_QZ-3V_8,22125
50
+ hardpy/pytest_hardpy/pytest_call.py,sha256=qUDrK1iUjhGEs4bmBFTk9E0YfFzsePoHhVDRY6ngRV8,22878
51
+ hardpy/pytest_hardpy/pytest_wrapper.py,sha256=j3zfSHgtx7V_LdUErGAjy0KZ14YYkXyYTwNO59NcIWI,4745
52
+ hardpy/pytest_hardpy/db/__init__.py,sha256=scaWueM5N_aMEuFCcMVkicpcqjx5JUi2IdEN9HmzuGs,792
53
+ hardpy/pytest_hardpy/db/base_store.py,sha256=d1lkTB7CpHTKysD2yuuGQFai44OtOmtTbq-WaBYojhw,5545
54
+ hardpy/pytest_hardpy/db/const.py,sha256=E_A0IKGeS3qyPX4fTfUE5ksARsrTKSVWqUkdmh8S_fo,1414
55
+ hardpy/pytest_hardpy/db/runstore.py,sha256=humoVBDZJGh7j_v5Xrf3P0HHaeRXC8oRdIj1QWGZizg,946
56
+ hardpy/pytest_hardpy/db/stand_type.py,sha256=p3AFtgMt-sn8QXRp60YM-xo2mEjZHUhYr_Mxhz1WyP0,7438
57
+ hardpy/pytest_hardpy/db/statestore.py,sha256=1s615c4OdzHd5u-464O-lcXoKulMfZ6moblhTWDHwSg,583
58
+ hardpy/pytest_hardpy/db/schema/__init__.py,sha256=1S73W3PLQt8gX5Y33nbX1JdwLvnrtlKH4cElID3pwuc,263
59
+ hardpy/pytest_hardpy/db/schema/v1.py,sha256=0RGZP-2lDeA3r8-simEEnjlHOAyziYSMXb9BINQyVbM,6377
60
+ hardpy/pytest_hardpy/reporter/__init__.py,sha256=rztpM2HlLUpMOvad0JHbZU4Mk8PDDQyCFXLhpLktGQI,322
61
+ hardpy/pytest_hardpy/reporter/base.py,sha256=Nz5cMTWfrVvn9sAQwRLAh_KXBP6zQoqEMpOkXCVpUCE,3494
62
+ hardpy/pytest_hardpy/reporter/hook_reporter.py,sha256=IAseKoQcZWlgS3NLYNnBOC5aGsJUgzyZLqljpd8Tfsg,15672
63
+ hardpy/pytest_hardpy/reporter/runner_reporter.py,sha256=d9hyThq0tywelPnIIHVED2SyztavE5LbgcBSejXfnhA,787
64
+ hardpy/pytest_hardpy/result/__init__.py,sha256=2afpuEuOcxYfIEOwWzsGZe960iQaPVCmsbYujijQg1s,592
65
+ hardpy/pytest_hardpy/result/couchdb_config.py,sha256=ujxyJYM2pdZzi3GZ2Zysbz2_ZeTRN5sQc8AGuzRJm_0,3243
66
+ hardpy/pytest_hardpy/result/report_loader/__init__.py,sha256=wq5Y-_JW2ExCRnQ9VVesKmTToEQrcTY5RxNJIWaT9ag,374
67
+ hardpy/pytest_hardpy/result/report_loader/couchdb_loader.py,sha256=KcZ0JkCgWhrj2J9M04JBDy0fpqtpVEYtu9GCLDG27pU,2255
68
+ hardpy/pytest_hardpy/result/report_loader/stand_cloud_loader.py,sha256=7iwk9E94jFkn_s0wRKjrRz0O00H4D4K75s6wZGlSoMI,3755
69
+ hardpy/pytest_hardpy/result/report_reader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
+ hardpy/pytest_hardpy/result/report_reader/couchdb_reader.py,sha256=lnWSX-0QKbdMwtqfCtW0tiH9W_ZEPqQ3rb7Lc8gES7E,5726
71
+ hardpy/pytest_hardpy/result/report_reader/stand_cloud_reader.py,sha256=uT7YSBu1QyURH9IkgRCdpbinn8LKXUhgVEhwPmGZV7I,3636
72
+ hardpy/pytest_hardpy/utils/__init__.py,sha256=zHln8ySBHesYAwYatLYkHol5TuuTTNOqrsMP7ONFEG0,1338
73
+ hardpy/pytest_hardpy/utils/const.py,sha256=xS3jBrW_D6IUTlAjSnLiHvSthieRHCj3uN_6fFAXS0w,1832
74
+ hardpy/pytest_hardpy/utils/dialog_box.py,sha256=eCLGQ-Z8rDPd_8ABHRtbkd7piSZcJoG-bCBmnyq29Pw,11375
75
+ hardpy/pytest_hardpy/utils/exception.py,sha256=1l2VBZLUnjPDoOs744MtaP7Y9FuXUq7koSdH2Eo31nk,1042
76
+ hardpy/pytest_hardpy/utils/machineid.py,sha256=6JAzUt7KtjTYn8kL9hSMaCQ20U8liH-zDT9v-5Ch7Q8,296
77
+ hardpy/pytest_hardpy/utils/node_info.py,sha256=DaW566WvsyWR66CThuZ38UoHwQa-pu-4WRLg61OXDnE,7134
78
+ hardpy/pytest_hardpy/utils/progress_calculator.py,sha256=TPl2gG0ZSvMe8otPythhF9hkD6fa6-mJAhy9yI83-yE,1071
79
+ hardpy-0.17.0.dist-info/METADATA,sha256=nugcdc1HjVxgBDtVEOVm9NBxnZl8VBknkboyji8VfXc,4898
80
+ hardpy-0.17.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
81
+ hardpy-0.17.0.dist-info/entry_points.txt,sha256=nL2sMkKMScNaOE0IPkYnu9Yr-BUswZvGSrwY-SxHY3E,102
82
+ hardpy-0.17.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
83
+ hardpy-0.17.0.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- import{g as G}from"./index-6RIgWzcZ.js";function $(w,c){for(var m=0;m<c.length;m++){const d=c[m];if(typeof d!="string"&&!Array.isArray(d)){for(const y in d)if(y!=="default"&&!(y in w)){const p=Object.getOwnPropertyDescriptor(d,y);p&&Object.defineProperty(w,y,p.get?p:{enumerable:!0,get:()=>d[y]})}}}return Object.freeze(Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}},U;function X(){return U||(U=1,function(w,c){var m={},d=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof m<"u"&&m,y=function(){function v(){this.fetch=!1,this.DOMException=d.DOMException}return v.prototype=d,new v}();(function(v){(function(u){var a=typeof v<"u"&&v||typeof self<"u"&&self||typeof a<"u"&&a,f={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function S(e){return e&&DataView.prototype.isPrototypeOf(e)}if(f.arrayBuffer)var F=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],I=ArrayBuffer.isView||function(e){return e&&F.indexOf(Object.prototype.toString.call(e))>-1};function _(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function T(e){return typeof e!="string"&&(e=String(e)),e}function B(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return f.iterable&&(t[Symbol.iterator]=function(){return t}),t}function s(e){this.map={},e instanceof s?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}s.prototype.append=function(e,t){e=_(e),t=T(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},s.prototype.delete=function(e){delete this.map[_(e)]},s.prototype.get=function(e){return e=_(e),this.has(e)?this.map[e]:null},s.prototype.has=function(e){return this.map.hasOwnProperty(_(e))},s.prototype.set=function(e,t){this.map[_(e)]=T(t)},s.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},s.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),B(e)},s.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),B(e)},s.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),B(e)},f.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);function O(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function D(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function M(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function q(e){var t=new FileReader,r=D(t);return t.readAsText(e),r}function H(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function x(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:f.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:f.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():f.arrayBuffer&&f.blob&&S(e)?(this._bodyArrayBuffer=x(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||I(e))?this._bodyArrayBuffer=x(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=O(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(M)}),this.text=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(H(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function C(e){var t=e.toUpperCase();return L.indexOf(t)>-1?t:e}function b(e,t){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new s(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new s(t.headers)),this.method=C(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function k(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),i=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function N(e){var t=new s,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
2
- `)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),o=i.shift().trim();if(o){var g=i.join(":").trim();t.append(o,g)}}),t}R.call(b.prototype);function l(e,t){if(!(this instanceof l))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new s(t.headers),this.url=t.url||"",this._initBody(e)}R.call(l.prototype),l.prototype.clone=function(){return new l(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},l.error=function(){var e=new l(null,{status:0,statusText:""});return e.type="error",e};var V=[301,302,303,307,308];l.redirect=function(e,t){if(V.indexOf(t)===-1)throw new RangeError("Invalid status code");return new l(null,{status:t,headers:{location:e}})},u.DOMException=a.DOMException;try{new u.DOMException}catch{u.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function P(e,t){return new Promise(function(r,n){var i=new b(e,t);if(i.signal&&i.signal.aborted)return n(new u.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function g(){o.abort()}o.onload=function(){var h={status:o.status,statusText:o.statusText,headers:N(o.getAllResponseHeaders()||"")};h.url="responseURL"in o?o.responseURL:h.headers.get("X-Request-URL");var A="response"in o?o.response:o.responseText;setTimeout(function(){r(new l(A,h))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){n(new u.DOMException("Aborted","AbortError"))},0)};function z(h){try{return h===""&&a.location.href?a.location.href:h}catch{return h}}o.open(i.method,z(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(f.blob?o.responseType="blob":f.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof s)?Object.getOwnPropertyNames(t.headers).forEach(function(h){o.setRequestHeader(h,T(t.headers[h]))}):i.headers.forEach(function(h,A){o.setRequestHeader(A,h)}),i.signal&&(i.signal.addEventListener("abort",g),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",g)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}return P.polyfill=!0,a.fetch||(a.fetch=P,a.Headers=s,a.Request=b,a.Response=l),u.Headers=s,u.Request=b,u.Response=l,u.fetch=P,u})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var p=d.fetch?d:y;c=p.fetch,c.default=p.fetch,c.fetch=p.fetch,c.Headers=p.Headers,c.Request=p.Request,c.Response=p.Response,w.exports=c}(E,E.exports)),E.exports}var j=X();const J=G(j),Q=$({__proto__:null,default:J},[j]);export{Q as b};