Skip to content

Commit

Permalink
ver 0.1.6-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
blademd committed Nov 19, 2023
1 parent ae25038 commit f86edfd
Show file tree
Hide file tree
Showing 41 changed files with 1,010 additions and 1,664 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dist/
#conf
conf
*.conf
settings/
saves/
log/

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

![thymus_default_screen](https://github.com/blademd/thymus/assets/1499024/cce6e2e8-02f1-4d46-82c6-daabf51e3d66)
![thymus_default_screen](https://github.com/blademd/thymus/assets/1499024/8c790c6a-7d11-4cd6-8283-52cf29e8472e)


# Thymus
Expand Down Expand Up @@ -33,6 +33,10 @@ Thymus supports:

</details>

## Installation

Use `pip` to install the project right from its sources (e.g., `pip install thymus/` or `python -m pip install thymus/`).

## Modes

Thymus operates in two modes:
Expand Down
136 changes: 42 additions & 94 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
[tool.poetry]
name = "thymus"
version = "0.1.5"
version = "0.1.6"
description = "A browser for network configuration files"
authors = ["Igor Malyushkin <gmalyushkin@gmail.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8.1"
textual = "0.40.0"
textual = "0.41.0"
netmiko = "^4.2.0"
thymus-ast = "^0.1.2"
thymus-ast = "^0.1.5.1"


[tool.poetry.group.dev.dependencies]
flake8 = "^6.0.0"
[tool.ruff]
line-length = 119

[tool.ruff.lint]
ignore = ["E721"]

[tool.ruff.format]
quote-style = "single"

[build-system]
requires = ["poetry-core"]
Expand Down
58 changes: 6 additions & 52 deletions thymus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
__version__ = '0.1.5-alpha'
__version__ = '0.1.6-alpha'

CONFIG_PATH = 'settings/'
CONFIG_NAME = 'thymus.json'
WELCOME_TEXT = '''\
WELCOME_TEXT = """\
▄▄▄█████▓ ██░ ██▓██ ██▓ ███▄ ▄███▓ █ ██ ██████
▓ ██▒ ▓▒▓██░ ██▒▒██ ██▒▓██▒▀█▀ ██▒ ██ ▓██▒▒██ ▒
▒ ▓██░ ▒░▒██▀▀██░ ▒██ ██░▓██ ▓██░▓██ ▒██░░ ▓██▄
Expand All @@ -15,10 +15,11 @@
░ ░ v{}
'''
"""
WELCOME_TEXT_LEN = 55
WRAPPER_DIR = '~/thymus_data/'
SAVES_DIR = 'saves/'
SCREENS_SAVES_DIR = 'saves/screenshots/'
SCREENS_DIR = 'screenshots/'
LOGGING_CONF_DIR = 'settings/'
LOGGING_CONF = LOGGING_CONF_DIR + 'logging.conf'
LOGGING_CONF_ENCODING = 'utf-8'
Expand All @@ -30,52 +31,5 @@
LOGGING_FILE_MAX_INSTANCES = 5
LOGGING_BUF_CAP = 65535
LOGGING_FORMAT = '%(asctime)s %(module)-14s %(levelname)-3s %(message)s'
LOGGING_DEFAULTS = f'''
[loggers]
keys=root
[handlers]
keys=hand01
[formatters]
keys=form01
[logger_root]
level={LOGGING_LEVEL}
handlers=hand01
[handler_hand01]
class=logging.handlers.RotatingFileHandler
level=NOTSET
formatter=form01
args=('{LOGGING_FILE}', 'a', {LOGGING_FILE_MAX_SIZE_BYTES}, {LOGGING_FILE_MAX_INSTANCES}, '{LOGGING_FILE_ENCODING}')
[formatter_form01]
format={LOGGING_FORMAT}
'''
N_VALUE_LIMIT = 65535
CONTEXT_HELP = {
'header': '[bold yellow]Welcome to {NOS} context.[/]',
'footer': '\nSome commands may be used with arguments. Please, see the [link=https://github.com/blademd/thymus/wiki]documentation[/link].\nEnter any command in the input field below.',
'modificators_header': '\nUse any of the next commands for the show command after a pipe symbol:',
'singletones': {
'show': 'To show a configuration of a current path use: [bold yellow]{CMDS}[/].',
'go': 'To switch a current path use: [bold yellow]{CMDS}[/].',
'top': 'To switch a current path to the top use: [bold yellow]{CMDS}[/].',
'up': 'To step back one or more sections use: [bold yellow]{CMDS}[/].',
'help': 'To show these hints use: [bold yellow]{CMDS}[/].',
'version': 'To show a version of this configuration file use: [bold yellow]{CMDS}[/].',
'set': 'To configure a current context use: [bold yellow]{CMDS}[/].',
'global': 'To configure or the application settings use: [bold yellow]{CMDS}[/] and [bold yellow]show[/] or [bold yellow]set[/].',
},
'modificators': {
'filter': 'To filter a line of lines from the output use: [bold yellow]{CMDS}[/].',
'wildcard': 'To filter a section of lines from the output use: [bold yellow]{CMDS}[/].',
'stubs': 'To show all finite instructions (stubs) for a current path use: [bold yellow]{CMDS}[/].',
'sections': 'To list all available nested sections use: [bold yellow]{CMDS}[/].',
'save': 'To save a content of a current path to a file use: [bold yellow]{CMDS}[/].',
'count': 'To count lines of a current section use: [bold yellow]{CMDS}[/].',
'diff': 'To compare two contexts use: [bold yellow]{CMDS}[/].',
'contains': 'To search a pattern in a configuration use: [bold yellow]{CMDS}[/].',
},
}
CONTEXT_HELP = 'templates/context_help.json'
Loading

0 comments on commit f86edfd

Please sign in to comment.