mirror of
https://github.com/dtomlinson91/panaetius.git
synced 2025-12-22 04:55:44 +00:00
workaround #1
This commit is contained in:
17
.vscode/settings.json
vendored
17
.vscode/settings.json
vendored
@@ -4,20 +4,5 @@
|
|||||||
"python.linting.enabled": true,
|
"python.linting.enabled": true,
|
||||||
"python.pythonPath": ".venv/bin/python",
|
"python.pythonPath": ".venv/bin/python",
|
||||||
"restructuredtext.confPath": "${workspaceFolder}/docs/source",
|
"restructuredtext.confPath": "${workspaceFolder}/docs/source",
|
||||||
"peacock.color": "#307E6A",
|
"peacock.color": "#307E6A"
|
||||||
"workbench.colorCustomizations": {
|
|
||||||
"editorGroup.border": "#3ea389",
|
|
||||||
"panel.border": "#3ea389",
|
|
||||||
"sash.hoverBorder": "#3ea389",
|
|
||||||
"sideBar.border": "#3ea389",
|
|
||||||
"statusBar.background": "#307e6a",
|
|
||||||
"statusBar.foreground": "#e7e7e7",
|
|
||||||
"statusBarItem.hoverBackground": "#3ea389",
|
|
||||||
"statusBarItem.remoteBackground": "#307e6a",
|
|
||||||
"statusBarItem.remoteForeground": "#e7e7e7",
|
|
||||||
"titleBar.activeBackground": "#307e6a",
|
|
||||||
"titleBar.activeForeground": "#e7e7e7",
|
|
||||||
"titleBar.inactiveBackground": "#307e6a99",
|
|
||||||
"titleBar.inactiveForeground": "#e7e7e799"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,16 +32,21 @@ See Tembo for an example: <https://github.com/tembo-pages/tembo-core/blob/main/t
|
|||||||
Example snippet to use in a module:
|
Example snippet to use in a module:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
"""Subpackage that contains the CLI application."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
import panaetius
|
import panaetius
|
||||||
from panaetius.exceptions import LoggingDirectoryDoesNotExistException
|
from panaetius.exceptions import LoggingDirectoryDoesNotExistException
|
||||||
|
|
||||||
|
|
||||||
if (config_path := os.environ.get("TEMBO_CONFIG")) is not None:
|
if (config_path := os.environ.get("TEMBO_CONFIG")) is not None:
|
||||||
CONFIG = panaetius.Config("tembo", config_path, skip_header_init=True)
|
CONFIG: Any = panaetius.Config("tembo", config_path, skip_header_init=True) # type: ignore
|
||||||
else:
|
else:
|
||||||
CONFIG = panaetius.Config("tembo", "~/tembo/.config", skip_header_init=True)
|
CONFIG: Any = panaetius.Config( # type: ignore
|
||||||
|
"tembo", "~/tembo/.config", skip_header_init=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
panaetius.set_config(CONFIG, "base_path", "~/tembo")
|
panaetius.set_config(CONFIG, "base_path", "~/tembo")
|
||||||
|
|||||||
@@ -106,6 +106,11 @@ class LoggingData(metaclass=ABCMeta):
|
|||||||
def format(self) -> str:
|
def format(self) -> str:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@property
|
||||||
|
@abstractmethod
|
||||||
|
def logging_level(self) -> str:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def __init__(self, logging_level: str):
|
def __init__(self, logging_level: str):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
@@ -119,8 +124,12 @@ class SimpleLogger(LoggingData):
|
|||||||
'"%(levelname)s",\n\t"message": "%(message)s"\n}',
|
'"%(levelname)s",\n\t"message": "%(message)s"\n}',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def logging_level(self) -> str:
|
||||||
|
return self._logging_level
|
||||||
|
|
||||||
def __init__(self, logging_level: str = "INFO"):
|
def __init__(self, logging_level: str = "INFO"):
|
||||||
self.logging_level = logging_level
|
self._logging_level = logging_level
|
||||||
|
|
||||||
|
|
||||||
class AdvancedLogger(LoggingData):
|
class AdvancedLogger(LoggingData):
|
||||||
@@ -133,8 +142,12 @@ class AdvancedLogger(LoggingData):
|
|||||||
'"%(levelname)s",\n\t"message": "%(message)s"\n}',
|
'"%(levelname)s",\n\t"message": "%(message)s"\n}',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def logging_level(self) -> str:
|
||||||
|
return self._logging_level
|
||||||
|
|
||||||
def __init__(self, logging_level: str = "INFO"):
|
def __init__(self, logging_level: str = "INFO"):
|
||||||
self.logging_level = logging_level
|
self._logging_level = logging_level
|
||||||
|
|
||||||
|
|
||||||
class CustomLogger(LoggingData):
|
class CustomLogger(LoggingData):
|
||||||
@@ -142,6 +155,10 @@ class CustomLogger(LoggingData):
|
|||||||
def format(self) -> str:
|
def format(self) -> str:
|
||||||
return str(self._format)
|
return str(self._format)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def logging_level(self) -> str:
|
||||||
|
return self._logging_level
|
||||||
|
|
||||||
def __init__(self, logging_format: str, logging_level: str = "INFO"):
|
def __init__(self, logging_format: str, logging_level: str = "INFO"):
|
||||||
self.logging_level = logging_level
|
self._logging_level = logging_level
|
||||||
self._format = logging_format
|
self._format = logging_format
|
||||||
|
|||||||
Reference in New Issue
Block a user