mirror of
https://github.com/dtomlinson91/tembo.git
synced 2025-12-22 09:45:44 +00:00
adding initial Page scaffolding
This commit is contained in:
18
.vscode/settings.json
vendored
Normal file
18
.vscode/settings.json
vendored
Normal file
@@ -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"
|
||||||
|
}
|
||||||
3
dev.todo
3
dev.todo
@@ -1,2 +1,5 @@
|
|||||||
Functionality:
|
Functionality:
|
||||||
☐ Handle case where there are no scopes in the config and command is invoked.
|
☐ Handle case where there are no scopes in the config and command is invoked.
|
||||||
|
|
||||||
|
Documentation:
|
||||||
|
☐ Document usage of Panaetius in a module?
|
||||||
|
|||||||
6
poetry.lock
generated
6
poetry.lock
generated
@@ -198,7 +198,7 @@ pyparsing = ">=2.0.2"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "panaetius"
|
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."
|
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"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
@@ -638,8 +638,8 @@ packaging = [
|
|||||||
{file = "packaging-21.0.tar.gz", hash = "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7"},
|
{file = "packaging-21.0.tar.gz", hash = "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7"},
|
||||||
]
|
]
|
||||||
panaetius = [
|
panaetius = [
|
||||||
{file = "panaetius-2.0.0-py3-none-any.whl", hash = "sha256:ccd3893c285b1ba4bf46cf24d45214a23d469e31b0f78962dba6fdd5c42a29dc"},
|
{file = "panaetius-2.1.0-py3-none-any.whl", hash = "sha256:ab524a2a2aac650d684ffbf601659f463d1cf8d2ca26e31df4a294ed9a22e03d"},
|
||||||
{file = "panaetius-2.0.0.tar.gz", hash = "sha256:53fbf197ccad264838b0efa5528372be33ac8cc9e3923b51fd5c8c73c0de610c"},
|
{file = "panaetius-2.1.0.tar.gz", hash = "sha256:0ac2efd70b055c71ad200427d19f6d4297242f321a5f50e32cc50e93ddfbffeb"},
|
||||||
]
|
]
|
||||||
pbr = [
|
pbr = [
|
||||||
{file = "pbr-5.6.0-py2.py3-none-any.whl", hash = "sha256:c68c661ac5cc81058ac94247278eeda6d2e6aecb3e227b0387c30d277e7ef8d4"},
|
{file = "pbr-5.6.0-py2.py3-none-any.whl", hash = "sha256:c68c661ac5cc81058ac94247278eeda6d2e6aecb3e227b0387c30d277e7ef8d4"},
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
1
tembo/journal/__init__.py
Normal file
1
tembo/journal/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from tembo.journal import pages
|
||||||
51
tembo/journal/pages.py
Normal file
51
tembo/journal/pages.py
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user