symetrie-hexapod 0.16.1__py3-none-any.whl → 0.16.2__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.
@@ -1,15 +1,13 @@
1
1
  import subprocess
2
2
  import sys
3
3
  import textwrap
4
- from pathlib import Path
5
4
  from typing import Annotated
6
- from typing import TextIO
7
5
 
8
6
  import rich
9
7
  import typer
10
8
 
11
- from egse.env import get_log_file_location
12
9
  from egse.system import all_logging_disabled
10
+ from egse.system import redirect_output_to_log
13
11
 
14
12
  puna = typer.Typer(name="puna", help="PUNA Positioning Hexapod, Symétrie")
15
13
 
@@ -18,25 +16,12 @@ zonda = typer.Typer(name="zonda", help="ZONDA Positioning Hexapod, Symétrie")
18
16
  joran = typer.Typer(name="joran", help="JORAN Positioning Hexapod, Symétrie")
19
17
 
20
18
 
21
- def redirect_output_to(output_fn: str) -> TextIO:
22
- """Open file in the log folder where process output will be redirected."""
23
-
24
- location = get_log_file_location()
25
- output_path = Path(location, output_fn).expanduser()
26
-
27
- rich.print(f"Output will be redirected to {output_path!s}")
28
-
29
- out = open(output_path, "w")
30
-
31
- return out
32
-
33
-
34
19
  def start_hexapod_cs_process(device_name, device_id, simulator):
35
20
  """Generic function to start the hexapod control server in the background."""
36
21
 
37
22
  rich.print(f"Starting the {device_name} hexapod control server for {device_id} – {simulator = }")
38
23
 
39
- out = redirect_output_to(f"{device_name.lower()}_cs.{device_id.lower()}.start.out")
24
+ out = redirect_output_to_log(f".{device_name.lower()}_cs.{device_id.lower()}.start.log")
40
25
 
41
26
  cmd = [sys.executable, "-m", f"egse.hexapod.symetrie.{device_name.lower()}_cs", "start", device_id]
42
27
  if simulator:
@@ -50,7 +35,7 @@ def stop_hexapod_cs_process(device_name, device_id):
50
35
 
51
36
  rich.print(f"Terminating hexapod {device_name} control server for {device_id}...")
52
37
 
53
- out = redirect_output_to(f"{device_name.lower()}_cs.{device_id.lower()}.stop.out")
38
+ out = redirect_output_to_log(f".{device_name.lower()}_cs.{device_id.lower()}.stop.log")
54
39
 
55
40
  cmd = [sys.executable, "-m", f"egse.hexapod.symetrie.{device_name.lower()}_cs", "stop", device_id]
56
41
 
@@ -114,7 +99,7 @@ def start_puna_sim(device_id: str):
114
99
 
115
100
  rich.print("Starting service PUNA Simulator")
116
101
 
117
- out = redirect_output_to(f"puna_sim.{device_id.lower()}.start.out")
102
+ out = redirect_output_to_log(f".puna_sim.{device_id.lower()}.start.log")
118
103
 
119
104
  subprocess.Popen(
120
105
  [sys.executable, "-m", "egse.hexapod.symetrie.puna_sim", "start", device_id],
@@ -130,7 +115,7 @@ def stop_puna_sim(device_id: str):
130
115
  """Stop the PUNA Hexapod Simulator."""
131
116
  rich.print("Terminating the PUNA simulator.")
132
117
 
133
- out = redirect_output_to(f"puna_sim.{device_id.lower()}.stop.out")
118
+ out = redirect_output_to_log(f".puna_sim.{device_id.lower()}.stop.log")
134
119
 
135
120
  subprocess.Popen(
136
121
  [sys.executable, "-m", "egse.hexapod.symetrie.puna_sim", "stop", device_id],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: symetrie-hexapod
3
- Version: 0.16.1
3
+ Version: 0.16.2
4
4
  Summary: Symetrie Hexapod implementation for CGSE
5
5
  Author: IvS KU Leuven
6
6
  Maintainer-email: Rik Huygen <rik.huygen@kuleuven.be>, Sara Regibo <sara.regibo@kuleuven.be>
@@ -26,9 +26,9 @@ egse/hexapod/symetrie/zonda_protocol.py,sha256=fdR110zt0IWI1U7usZu7aajmGPvJoHjXZ
26
26
  egse/hexapod/symetrie/zonda_ui.py,sha256=IYqymUL_sSmIgeJf8jY_pocsyfi36XzJeZCaMChhWaQ,14140
27
27
  symetrie_hexapod/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  symetrie_hexapod/cgse_explore.py,sha256=0Pnz4fwbTQBRHoliF_dIJclK-7AaHmDRsAvsOuzDoGg,423
29
- symetrie_hexapod/cgse_services.py,sha256=L6T56fXYP8LNJYPhJu6x_UfJOIX3FOfhKqAoS8aN00g,5720
29
+ symetrie_hexapod/cgse_services.py,sha256=krF8Lk1uTNiRdZIxuaWtEDt8Q1cxpXOd0qgT9yefbOE,5350
30
30
  symetrie_hexapod/settings.yaml,sha256=dZv5_WwP6raLnSkcleNrSKE9_HK5KajLqcJssZfBpK8,908
31
- symetrie_hexapod-0.16.1.dist-info/METADATA,sha256=LjJj2_WYwDVxnPd6Xft-FOnHm-QEeFssANonA8ZB3qE,650
32
- symetrie_hexapod-0.16.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
33
- symetrie_hexapod-0.16.1.dist-info/entry_points.txt,sha256=xA10Nh76SW_5U0wLWHFJV3F0VTTUPOEOHW-HseDqPWk,665
34
- symetrie_hexapod-0.16.1.dist-info/RECORD,,
31
+ symetrie_hexapod-0.16.2.dist-info/METADATA,sha256=lUO5U78PjuMiF6yWG3Gs0cNGCuDOxfR-ccptwIOsZUk,650
32
+ symetrie_hexapod-0.16.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
33
+ symetrie_hexapod-0.16.2.dist-info/entry_points.txt,sha256=xA10Nh76SW_5U0wLWHFJV3F0VTTUPOEOHW-HseDqPWk,665
34
+ symetrie_hexapod-0.16.2.dist-info/RECORD,,