rtems-proxy 0.2.1__tar.gz → 0.2.3__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.
Files changed (44) hide show
  1. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/PKG-INFO +1 -1
  2. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy/_version.py +2 -2
  3. rtems-proxy-0.2.3/src/rtems_proxy/copy.py +37 -0
  4. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy/telnet.py +26 -12
  5. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy.egg-info/PKG-INFO +1 -1
  6. rtems-proxy-0.2.1/src/rtems_proxy/copy.py +0 -31
  7. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.copier-answers.yml +0 -0
  8. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.devcontainer/devcontainer.json +0 -0
  9. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/CONTRIBUTING.md +0 -0
  10. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/actions/install_requirements/action.yml +0 -0
  11. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/dependabot.yml +0 -0
  12. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/pages/index.html +0 -0
  13. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/pages/make_switcher.py +0 -0
  14. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/workflows/_check.yml +0 -0
  15. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/workflows/_dist.yml +0 -0
  16. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/workflows/_pypi.yml +0 -0
  17. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/workflows/_release.yml +0 -0
  18. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/workflows/_test.yml +0 -0
  19. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/workflows/_tox.yml +0 -0
  20. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.github/workflows/ci.yml +0 -0
  21. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.gitignore +0 -0
  22. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.pre-commit-config.yaml +0 -0
  23. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.vscode/extensions.json +0 -0
  24. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.vscode/launch.json +0 -0
  25. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.vscode/settings.json +0 -0
  26. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/.vscode/tasks.json +0 -0
  27. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/Dockerfile +0 -0
  28. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/LICENSE +0 -0
  29. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/README.md +0 -0
  30. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/catalog-info.yaml +0 -0
  31. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/proxy-start.sh +0 -0
  32. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/pyproject.toml +0 -0
  33. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/requirements.txt +0 -0
  34. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/setup.cfg +0 -0
  35. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy/__init__.py +0 -0
  36. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy/__main__.py +0 -0
  37. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy/globals.py +0 -0
  38. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy.egg-info/SOURCES.txt +0 -0
  39. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
  40. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
  41. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy.egg-info/requires.txt +0 -0
  42. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/src/rtems_proxy.egg-info/top_level.txt +0 -0
  43. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/tests/conftest.py +0 -0
  44. {rtems-proxy-0.2.1 → rtems-proxy-0.2.3}/tests/test_cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rtems-proxy
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
5
5
  Author-email: Giles Knap <giles.knap@diamond.ac.uk>
6
6
  License: Apache License
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.2.1'
16
- __version_tuple__ = version_tuple = (0, 2, 1)
15
+ __version__ = version = '0.2.3'
16
+ __version_tuple__ = version_tuple = (0, 2, 3)
@@ -0,0 +1,37 @@
1
+ """
2
+ functions for moving IOC assets into position for a remote IOC to access
3
+ """
4
+
5
+ import re
6
+ import shutil
7
+ from pathlib import Path
8
+
9
+ from .globals import GLOBALS
10
+
11
+
12
+ def copy_rtems():
13
+ """
14
+ Copy RTEMS binaries to a location where the RTEMS IOC can access them
15
+ """
16
+ # root of pvc mount into which we copy the IOC files for the RTEMS IOC to access
17
+ root = GLOBALS.RTEMS_ROOT
18
+ # root of the path that the RTEMS IOC expects to find the IOC files
19
+ rtems_root = Path("/iocs") / GLOBALS.IOC_GROUP / GLOBALS.IOC_NAME
20
+ # where to copy the Generic IOC folder to (at present only holds the dbd folder)
21
+ dest_ioc = root / "ioc"
22
+ dest_runtime = root / "runtime"
23
+
24
+ # because we are moving the ioc files we need to fix up startup script paths
25
+ startup = GLOBALS.RUNTIME / "st.cmd"
26
+ cmd_txt = startup.read_text()
27
+ cmd_txt = re.sub("/epics/", f"{str(rtems_root)}/", cmd_txt)
28
+ startup.write_text(cmd_txt)
29
+
30
+ # clean up previous IOC binaries
31
+ shutil.rmtree(dest_ioc)
32
+ shutil.rmtree(dest_runtime)
33
+ # move all the files needed for runtime into the PVC that is being shared
34
+ # over nfs/tftp by the nfsv2-tftp service
35
+ Path.mkdir(dest_ioc, exist_ok=True)
36
+ shutil.copytree(GLOBALS.IOC / "dbd", dest_ioc, symlinks=True, dirs_exist_ok=True)
37
+ shutil.copytree(GLOBALS.RUNTIME, dest_runtime, dirs_exist_ok=True)
@@ -1,5 +1,8 @@
1
1
  import asyncio
2
2
  import signal
3
+ import sys
4
+ import termios
5
+ import tty
3
6
  from time import sleep
4
7
 
5
8
  import telnetlib3
@@ -21,18 +24,29 @@ class TelnetRTEMS:
21
24
  self.terminated = True
22
25
 
23
26
  async def user_input(self, writer):
24
- loop = asyncio.events._get_running_loop()
25
-
26
- while self.running:
27
- # run the wait for input in a separate thread
28
- cmd = await loop.run_in_executor(None, input)
29
- # look for control + ] to terminate the session
30
- if b"\x1d" in cmd.encode():
31
- self.running = False
32
- break
33
- writer.write(cmd)
34
- writer.write("\r")
35
- writer.close()
27
+ def get_char():
28
+ ch = sys.stdin.read(1)
29
+ return ch
30
+
31
+ stdin_fd = sys.stdin.fileno()
32
+ old_settings = termios.tcgetattr(stdin_fd)
33
+
34
+ try:
35
+ tty.setraw(sys.stdin.fileno())
36
+ loop = asyncio.events._get_running_loop()
37
+
38
+ while self.running:
39
+ # run the wait for input in a separate thread
40
+ next_ch = await loop.run_in_executor(None, get_char)
41
+ # look for control + ] to terminate the session
42
+ if b"\x1d" in next_ch.encode():
43
+ self.running = False
44
+ break
45
+ writer.write(next_ch)
46
+
47
+ finally:
48
+ termios.tcsetattr(stdin_fd, termios.TCSADRAIN, old_settings)
49
+ writer.close()
36
50
 
37
51
  async def server_output(self, reader):
38
52
  while self.running:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rtems-proxy
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
5
5
  Author-email: Giles Knap <giles.knap@diamond.ac.uk>
6
6
  License: Apache License
@@ -1,31 +0,0 @@
1
- """
2
- functions for moving IOC assets into position for a remote IOC to access
3
- """
4
-
5
- import re
6
- import shutil
7
- from pathlib import Path
8
-
9
- from .globals import GLOBALS
10
-
11
-
12
- def copy_rtems():
13
- """
14
- Copy RTEMS binaries to a location where the RTEMS IOC can access them
15
- """
16
- root = GLOBALS.RTEMS_ROOT
17
- ioc_bins = (GLOBALS.IOC / "bin") / GLOBALS.EPICS_TARGET_ARCH
18
- bin_dest = root / "bin"
19
-
20
- # because we are moving the ioc files we need to fix up startup script paths
21
- startup = GLOBALS.RUNTIME / "st.cmd"
22
- cmd_txt = startup.read_text()
23
- cmd_txt = re.sub("/epics/", str(root), cmd_txt)
24
- startup.write_text(cmd_txt)
25
-
26
- # move all the files needed for runtime into the PVC that is being shared
27
- # over nfs/tftp by the nfsv2-tftp service
28
- shutil.copytree(GLOBALS.IOC, root / "ioc", symlinks=True, dirs_exist_ok=True)
29
- shutil.copytree(GLOBALS.RUNTIME, root / "runtime", dirs_exist_ok=True)
30
- Path.mkdir(bin_dest, exist_ok=True)
31
- shutil.move(ioc_bins / "ioc.boot", bin_dest)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes