Skip to content

Commit

Permalink
Merge pull request #28 from markqvist/main
Browse files Browse the repository at this point in the history
Fix invalid escape sequence handling for terminal escape sequences
  • Loading branch information
acehoss authored May 21, 2024
2 parents 0221e52 + c28adee commit a7287a7
Show file tree
Hide file tree
Showing 8 changed files with 519 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ Process messages received from listener.
- [X] ~~Test and fix more issues~~
- [ ] More betas
- [ ] Enhancement Ideas
- [ ] `authorized_keys` mode similar to SSH to allow one listener
- [x] `authorized_keys` mode similar to SSH to allow one listener
process to serve multiple users
- [ ] Git over `rnsh` (git remote helper)
- [ ] Sliding window acknowledgements for improved throughput
Expand Down
9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
[tool.poetry]
name = "rnsh"
version = "0.1.3"
version = "0.1.4"
description = "Shell over Reticulum"
authors = ["acehoss <[email protected]>"]
license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.7"
docopt = "^0.6.2"
rns = ">=0.5.9"
# rns = { git = "https://github.com/acehoss/Reticulum.git", branch = "feature/channel" }
# rns = { path = "../Reticulum/", develop = true }
tomli = "^2.0.1"
rns = ">=0.7.4"

[tool.poetry.scripts]
rnsh = 'rnsh.rnsh:rnsh_cli'
Expand All @@ -22,6 +18,7 @@ pytest = "^7.2.1"
setuptools = "^67.2.0"
pytest-asyncio = "^0.20.3"
safety = "^2.3.5"
tomli = "^2.0.1"

[tool.pytest.ini_options]
markers = [
Expand Down
24 changes: 16 additions & 8 deletions rnsh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,28 @@
import os
module_abs_filename = os.path.abspath(__file__)
module_dir = os.path.dirname(module_abs_filename)
# print(os.path.dirname(module_dir))

def _get_version():
def pkg_res_version():
import pkg_resources
return pkg_resources.get_distribution("rnsh").version

def tomli_version():
import tomli
return tomli.load(open(os.path.join(os.path.dirname(module_dir), "pyproject.toml"), "rb"))["tool"]["poetry"]["version"]

try:
try:
import tomli
return tomli.load(open(os.path.join(os.path.dirname(module_dir), "pyproject.toml"), "rb"))["tool"]["poetry"]["version"]
except:
if (os.path.isfile(os.path.join(os.path.dirname(module_dir), "pyproject.toml"))):
try:
import pkg_resources
return pkg_resources.get_distribution("rnsh").version
return tomli_version()
except:
return "0.0.0"

else:
try:
return pkg_res_version()
except:
return "0.0.0"

except:
return "0.0.0"

Expand Down
2 changes: 1 addition & 1 deletion rnsh/args.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import TypeVar
import RNS
import rnsh
import docopt
import sys
from rnsh import docopt

_T = TypeVar("_T")

Expand Down
Loading

0 comments on commit a7287a7

Please sign in to comment.