torbot 3.0.7__tar.gz → 3.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {torbot-3.0.7 → torbot-3.0.8}/PKG-INFO +1 -1
- {torbot-3.0.7 → torbot-3.0.8}/pyproject.toml +1 -1
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/config.py +7 -7
- {torbot-3.0.7 → torbot-3.0.8}/.env +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/LICENSE.md +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/__init__.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/__main__.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/main.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/__init__.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/api.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/collect_data.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/color.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/info.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/link_io.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/linktree.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/log.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/nlp/README.md +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/nlp/__init__.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/nlp/gather_data.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/nlp/main.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/nlp/website_classification.csv +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/savefile.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/tests/TESTING.md +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/tests/__init__.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/tests/test_pagereader.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/tests/test_savetofile.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/updater.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/modules/validators.py +0 -0
- {torbot-3.0.7 → torbot-3.0.8}/torbot/version.py +0 -0
|
@@ -5,12 +5,9 @@ import sys
|
|
|
5
5
|
from dotenv import load_dotenv
|
|
6
6
|
from inspect import getsourcefile
|
|
7
7
|
|
|
8
|
-
script_directory = os.path.dirname(os.path.abspath(sys.argv[0]))
|
|
9
|
-
print(script_directory)
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
load_dotenv(verbose=True)
|
|
9
|
+
config_file_path = (os.path.abspath(getsourcefile(lambda:0)))
|
|
10
|
+
load_dotenv(config_file_path, verbose=True)
|
|
14
11
|
port = os.getenv("PORT")
|
|
15
12
|
host = os.getenv("HOST")
|
|
16
13
|
|
|
@@ -27,11 +24,14 @@ def get_log_level() -> int:
|
|
|
27
24
|
|
|
28
25
|
def get_data_directory():
|
|
29
26
|
data_directory = os.getenv('TORBOT_DATA_DIR')
|
|
27
|
+
|
|
28
|
+
# if a path is not set, write data to the config directory
|
|
29
|
+
config_directory = os.path.dirname(config_file_path)
|
|
30
30
|
if not data_directory:
|
|
31
|
-
data_directory =
|
|
31
|
+
data_directory = config_directory
|
|
32
32
|
|
|
33
33
|
if data_directory.strip() == "":
|
|
34
|
-
data_directory =
|
|
34
|
+
data_directory = config_directory
|
|
35
35
|
|
|
36
36
|
# create directory if it doesn't exist
|
|
37
37
|
if not os.path.exists(data_directory):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|