rtems-proxy 0.2.2__tar.gz → 0.2.4__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 (43) hide show
  1. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/PKG-INFO +1 -1
  2. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy/_version.py +2 -2
  3. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy/copy.py +5 -4
  4. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy/telnet.py +26 -12
  5. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy.egg-info/PKG-INFO +1 -1
  6. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.copier-answers.yml +0 -0
  7. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.devcontainer/devcontainer.json +0 -0
  8. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/CONTRIBUTING.md +0 -0
  9. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/actions/install_requirements/action.yml +0 -0
  10. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/dependabot.yml +0 -0
  11. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/pages/index.html +0 -0
  12. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/pages/make_switcher.py +0 -0
  13. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/workflows/_check.yml +0 -0
  14. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/workflows/_dist.yml +0 -0
  15. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/workflows/_pypi.yml +0 -0
  16. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/workflows/_release.yml +0 -0
  17. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/workflows/_test.yml +0 -0
  18. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/workflows/_tox.yml +0 -0
  19. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.github/workflows/ci.yml +0 -0
  20. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.gitignore +0 -0
  21. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.pre-commit-config.yaml +0 -0
  22. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.vscode/extensions.json +0 -0
  23. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.vscode/launch.json +0 -0
  24. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.vscode/settings.json +0 -0
  25. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/.vscode/tasks.json +0 -0
  26. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/Dockerfile +0 -0
  27. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/LICENSE +0 -0
  28. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/README.md +0 -0
  29. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/catalog-info.yaml +0 -0
  30. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/proxy-start.sh +0 -0
  31. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/pyproject.toml +0 -0
  32. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/requirements.txt +0 -0
  33. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/setup.cfg +0 -0
  34. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy/__init__.py +0 -0
  35. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy/__main__.py +0 -0
  36. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy/globals.py +0 -0
  37. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy.egg-info/SOURCES.txt +0 -0
  38. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
  39. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
  40. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy.egg-info/requires.txt +0 -0
  41. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/src/rtems_proxy.egg-info/top_level.txt +0 -0
  42. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/tests/conftest.py +0 -0
  43. {rtems-proxy-0.2.2 → rtems-proxy-0.2.4}/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.2
3
+ Version: 0.2.4
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.2'
16
- __version_tuple__ = version_tuple = (0, 2, 2)
15
+ __version__ = version = '0.2.4'
16
+ __version_tuple__ = version_tuple = (0, 2, 4)
@@ -17,10 +17,9 @@ def copy_rtems():
17
17
  root = GLOBALS.RTEMS_ROOT
18
18
  # root of the path that the RTEMS IOC expects to find the IOC files
19
19
  rtems_root = Path("/iocs") / GLOBALS.IOC_GROUP / GLOBALS.IOC_NAME
20
- # the binary blob to load into the RTEMS IOC via TFTP
21
- ioc_bin = (GLOBALS.IOC / "bin") / GLOBALS.EPICS_TARGET_ARCH / "ioc.boot"
22
20
  # where to copy the Generic IOC folder to (at present only holds the dbd folder)
23
21
  dest_ioc = root / "ioc"
22
+ dest_runtime = root / "runtime"
24
23
 
25
24
  # because we are moving the ioc files we need to fix up startup script paths
26
25
  startup = GLOBALS.RUNTIME / "st.cmd"
@@ -28,9 +27,11 @@ def copy_rtems():
28
27
  cmd_txt = re.sub("/epics/", f"{str(rtems_root)}/", cmd_txt)
29
28
  startup.write_text(cmd_txt)
30
29
 
30
+ # clean up previous IOC binaries
31
+ shutil.rmtree(dest_ioc, ignore_errors=True)
32
+ shutil.rmtree(dest_runtime, ignore_errors=True)
31
33
  # move all the files needed for runtime into the PVC that is being shared
32
34
  # over nfs/tftp by the nfsv2-tftp service
33
35
  Path.mkdir(dest_ioc, exist_ok=True)
34
36
  shutil.copytree(GLOBALS.IOC / "dbd", dest_ioc, symlinks=True, dirs_exist_ok=True)
35
- shutil.copytree(GLOBALS.RUNTIME, root / "runtime", dirs_exist_ok=True)
36
- shutil.copy(ioc_bin, root)
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.2
3
+ Version: 0.2.4
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes