diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index a119bd2..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..80eea8e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,18 @@ +{ + "workbench.colorCustomizations": { + "editorGroup.border": "#d68b62", + "panel.border": "#d68b62", + "sash.hoverBorder": "#d68b62", + "sideBar.border": "#d68b62", + "statusBar.background": "#cc6d39", + "statusBar.foreground": "#15202b", + "statusBarItem.hoverBackground": "#a7572b", + "statusBarItem.remoteBackground": "#cc6d39", + "statusBarItem.remoteForeground": "#15202b", + "titleBar.activeBackground": "#cc6d39", + "titleBar.activeForeground": "#15202b", + "titleBar.inactiveBackground": "#cc6d3999", + "titleBar.inactiveForeground": "#15202b99" + }, + "peacock.color": "#CC6D39" +} diff --git a/dev.todo b/dev.todo index 99c54ad..35b7cac 100644 --- a/dev.todo +++ b/dev.todo @@ -1,2 +1,5 @@ Functionality: ☐ Handle case where there are no scopes in the config and command is invoked. + +Documentation: + ☐ Document usage of Panaetius in a module? diff --git a/poetry.lock b/poetry.lock index d6b1bbf..cd73ef9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -198,7 +198,7 @@ pyparsing = ">=2.0.2" [[package]] name = "panaetius" -version = "2.0.0" +version = "2.1.0" description = "Python module to gracefully handle a .config file/environment variables for scripts, with built in masking for sensitive options. Provides a Splunk friendly formatted logger instance." category = "main" optional = false @@ -638,8 +638,8 @@ packaging = [ {file = "packaging-21.0.tar.gz", hash = "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7"}, ] panaetius = [ - {file = "panaetius-2.0.0-py3-none-any.whl", hash = "sha256:ccd3893c285b1ba4bf46cf24d45214a23d469e31b0f78962dba6fdd5c42a29dc"}, - {file = "panaetius-2.0.0.tar.gz", hash = "sha256:53fbf197ccad264838b0efa5528372be33ac8cc9e3923b51fd5c8c73c0de610c"}, + {file = "panaetius-2.1.0-py3-none-any.whl", hash = "sha256:ab524a2a2aac650d684ffbf601659f463d1cf8d2ca26e31df4a294ed9a22e03d"}, + {file = "panaetius-2.1.0.tar.gz", hash = "sha256:0ac2efd70b055c71ad200427d19f6d4297242f321a5f50e32cc50e93ddfbffeb"}, ] pbr = [ {file = "pbr-5.6.0-py2.py3-none-any.whl", hash = "sha256:c68c661ac5cc81058ac94247278eeda6d2e6aecb3e227b0387c30d277e7ef8d4"}, diff --git a/tembo/__pycache__/__init__.cpython-38.pyc b/tembo/__pycache__/__init__.cpython-38.pyc index f16c65d..f08dc10 100644 Binary files a/tembo/__pycache__/__init__.cpython-38.pyc and b/tembo/__pycache__/__init__.cpython-38.pyc differ diff --git a/tembo/__pycache__/cli.cpython-38.pyc b/tembo/__pycache__/cli.cpython-38.pyc index db63f31..57f7afb 100644 Binary files a/tembo/__pycache__/cli.cpython-38.pyc and b/tembo/__pycache__/cli.cpython-38.pyc differ diff --git a/tembo/journal/__init__.py b/tembo/journal/__init__.py new file mode 100644 index 0000000..2235318 --- /dev/null +++ b/tembo/journal/__init__.py @@ -0,0 +1 @@ +from tembo.journal import pages diff --git a/tembo/journal/pages.py b/tembo/journal/pages.py new file mode 100644 index 0000000..d2702d2 --- /dev/null +++ b/tembo/journal/pages.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from abc import ABCMeta, abstractmethod + + +class PageCreator: + @abstractmethod + def create_page(self, path, user_input, raw_entry_input) -> Page: + pass + + +class ScopedPageCreator(PageCreator): + def create_page( + self, path: str, user_input, raw_entry_input: dict | None = None + ) -> Page: + pass + + +class Page(metaclass=ABCMeta): + @abstractmethod + def __init__(self) -> None: + pass + + @abstractmethod + def save_to_disk(self) -> None: + pass + + +class ScopedPage(Page): + """A Page that uses substitute tokens.""" + + def __init__(self, path: str, raw_entry_input: dict): + self.path = path + self._raw_entry_input = raw_entry_input + self._squashed_content: dict = {} + self._page_content: str = "" + + def save_to_disk(self) -> None: + # create the file/folder if it doesnt exist + pass + + def _convert_to_path(self): + # take a path str and convert to pathlib + # substitute the tokens in + pass + + def squash_raw_entry_input(self) -> None: + pass + + def substitute_tokens(self) -> None: + pass