update
This commit is contained in:
29
scripts/helper/config.py
Executable file
29
scripts/helper/config.py
Executable file
@@ -0,0 +1,29 @@
|
||||
import os
|
||||
|
||||
|
||||
class Config():
|
||||
|
||||
def __init__(self) -> None:
|
||||
self._paperless_url = os.environ["PAPERLESS_BASE_URL"]
|
||||
self._auth_token = os.environ["PAPERLESS_POST_CONSUME_AUTH_TOKEN"]
|
||||
self._notify_tag = os.getenv("PAPERLESS_POST_CONSUME_EXTRACTOR_NOTIFY_TAG", "Title changed")
|
||||
self._expand_by_date = (os.getenv("PAPERLESS_POST_CONSUME_EXPAND_BY_DATE", 'True').lower() in ('false', '0', 'f'))
|
||||
|
||||
def get_paperless_url(self):
|
||||
return self._paperless_url
|
||||
|
||||
def get_paperless_api_url(self):
|
||||
return self._paperless_url + "/api"
|
||||
|
||||
def get_auth_token(self):
|
||||
return self._auth_token
|
||||
|
||||
def get_notify_tag(self) -> str:
|
||||
return self._notify_tag
|
||||
|
||||
def expand_title_by_date(self) -> bool:
|
||||
return True #self._expand_by_date
|
||||
|
||||
def __str__(self) -> str:
|
||||
return " ".join([self._paperless_url, self.get_paperless_api_url(), self._auth_token])
|
||||
|
||||
Reference in New Issue
Block a user