data-sourcerer 0.1.0__py3-none-any.whl
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.
- data_sourcerer-0.1.0.dist-info/METADATA +52 -0
- data_sourcerer-0.1.0.dist-info/RECORD +95 -0
- data_sourcerer-0.1.0.dist-info/WHEEL +5 -0
- data_sourcerer-0.1.0.dist-info/entry_points.txt +2 -0
- data_sourcerer-0.1.0.dist-info/licenses/LICENSE +21 -0
- data_sourcerer-0.1.0.dist-info/top_level.txt +1 -0
- sourcerer/__init__.py +15 -0
- sourcerer/domain/__init__.py +13 -0
- sourcerer/domain/access_credentials/__init__.py +7 -0
- sourcerer/domain/access_credentials/entities.py +53 -0
- sourcerer/domain/access_credentials/exceptions.py +17 -0
- sourcerer/domain/access_credentials/repositories.py +84 -0
- sourcerer/domain/access_credentials/services.py +91 -0
- sourcerer/domain/file_system/__init__.py +7 -0
- sourcerer/domain/file_system/entities.py +70 -0
- sourcerer/domain/file_system/exceptions.py +17 -0
- sourcerer/domain/file_system/services.py +64 -0
- sourcerer/domain/shared/__init__.py +6 -0
- sourcerer/domain/shared/entities.py +18 -0
- sourcerer/domain/storage_provider/__init__.py +7 -0
- sourcerer/domain/storage_provider/entities.py +86 -0
- sourcerer/domain/storage_provider/exceptions.py +17 -0
- sourcerer/domain/storage_provider/services.py +130 -0
- sourcerer/infrastructure/__init__.py +13 -0
- sourcerer/infrastructure/access_credentials/__init__.py +7 -0
- sourcerer/infrastructure/access_credentials/exceptions.py +16 -0
- sourcerer/infrastructure/access_credentials/registry.py +120 -0
- sourcerer/infrastructure/access_credentials/repositories.py +119 -0
- sourcerer/infrastructure/access_credentials/services.py +396 -0
- sourcerer/infrastructure/db/__init__.py +6 -0
- sourcerer/infrastructure/db/config.py +73 -0
- sourcerer/infrastructure/db/models.py +47 -0
- sourcerer/infrastructure/file_system/__init__.py +7 -0
- sourcerer/infrastructure/file_system/exceptions.py +89 -0
- sourcerer/infrastructure/file_system/services.py +147 -0
- sourcerer/infrastructure/storage_provider/__init__.py +7 -0
- sourcerer/infrastructure/storage_provider/exceptions.py +78 -0
- sourcerer/infrastructure/storage_provider/registry.py +84 -0
- sourcerer/infrastructure/storage_provider/services.py +509 -0
- sourcerer/infrastructure/utils.py +106 -0
- sourcerer/presentation/__init__.py +12 -0
- sourcerer/presentation/app.py +36 -0
- sourcerer/presentation/di_container.py +46 -0
- sourcerer/presentation/screens/__init__.py +0 -0
- sourcerer/presentation/screens/critical_error/__init__.py +0 -0
- sourcerer/presentation/screens/critical_error/main.py +78 -0
- sourcerer/presentation/screens/critical_error/styles.tcss +41 -0
- sourcerer/presentation/screens/file_system_finder/main.py +248 -0
- sourcerer/presentation/screens/file_system_finder/styles.tcss +44 -0
- sourcerer/presentation/screens/file_system_finder/widgets/__init__.py +0 -0
- sourcerer/presentation/screens/file_system_finder/widgets/file_system_navigator.py +810 -0
- sourcerer/presentation/screens/main/__init__.py +0 -0
- sourcerer/presentation/screens/main/main.py +469 -0
- sourcerer/presentation/screens/main/messages/__init__.py +0 -0
- sourcerer/presentation/screens/main/messages/delete_request.py +12 -0
- sourcerer/presentation/screens/main/messages/download_request.py +12 -0
- sourcerer/presentation/screens/main/messages/preview_request.py +10 -0
- sourcerer/presentation/screens/main/messages/resizing_rule.py +21 -0
- sourcerer/presentation/screens/main/messages/select_storage_item.py +11 -0
- sourcerer/presentation/screens/main/messages/uncheck_files_request.py +8 -0
- sourcerer/presentation/screens/main/messages/upload_request.py +10 -0
- sourcerer/presentation/screens/main/mixins/__init__.py +0 -0
- sourcerer/presentation/screens/main/mixins/resize_containers_watcher_mixin.py +144 -0
- sourcerer/presentation/screens/main/styles.tcss +32 -0
- sourcerer/presentation/screens/main/widgets/__init__.py +0 -0
- sourcerer/presentation/screens/main/widgets/gradient.py +45 -0
- sourcerer/presentation/screens/main/widgets/resizing_rule.py +67 -0
- sourcerer/presentation/screens/main/widgets/storage_content.py +691 -0
- sourcerer/presentation/screens/main/widgets/storage_list_sidebar.py +143 -0
- sourcerer/presentation/screens/preview_content/__init__.py +0 -0
- sourcerer/presentation/screens/preview_content/main.py +59 -0
- sourcerer/presentation/screens/preview_content/styles.tcss +26 -0
- sourcerer/presentation/screens/provider_creds_list/__init__.py +0 -0
- sourcerer/presentation/screens/provider_creds_list/main.py +164 -0
- sourcerer/presentation/screens/provider_creds_list/styles.tcss +65 -0
- sourcerer/presentation/screens/provider_creds_registration/__init__.py +0 -0
- sourcerer/presentation/screens/provider_creds_registration/main.py +264 -0
- sourcerer/presentation/screens/provider_creds_registration/styles.tcss +42 -0
- sourcerer/presentation/screens/question/__init__.py +0 -0
- sourcerer/presentation/screens/question/main.py +31 -0
- sourcerer/presentation/screens/question/styles.tcss +33 -0
- sourcerer/presentation/screens/shared/__init__.py +0 -0
- sourcerer/presentation/screens/shared/containers.py +13 -0
- sourcerer/presentation/screens/shared/widgets/__init__.py +0 -0
- sourcerer/presentation/screens/shared/widgets/button.py +54 -0
- sourcerer/presentation/screens/shared/widgets/labeled_input.py +80 -0
- sourcerer/presentation/screens/storage_action_progress/__init__.py +0 -0
- sourcerer/presentation/screens/storage_action_progress/main.py +476 -0
- sourcerer/presentation/screens/storage_action_progress/styles.tcss +43 -0
- sourcerer/presentation/settings.py +31 -0
- sourcerer/presentation/themes/__init__.py +0 -0
- sourcerer/presentation/themes/github_dark.py +21 -0
- sourcerer/presentation/utils.py +69 -0
- sourcerer/settings.py +72 -0
- sourcerer/utils.py +32 -0
sourcerer/settings.py
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
"""
|
2
|
+
Application settings module.
|
3
|
+
|
4
|
+
This module contains configuration settings for the application,
|
5
|
+
including encryption keys, UI constants, and file type definitions.
|
6
|
+
It centralizes configuration values to make them easily accessible
|
7
|
+
and modifiable throughout the application.
|
8
|
+
"""
|
9
|
+
|
10
|
+
import os
|
11
|
+
from pathlib import Path
|
12
|
+
|
13
|
+
from platformdirs import user_state_dir
|
14
|
+
|
15
|
+
from sourcerer.utils import get_encryption_key
|
16
|
+
|
17
|
+
APP_NAME = "sourcerer"
|
18
|
+
|
19
|
+
APP_DIR = Path(user_state_dir(APP_NAME))
|
20
|
+
os.makedirs(APP_DIR, exist_ok=True)
|
21
|
+
|
22
|
+
DB_NAME = "sourcerer.db"
|
23
|
+
|
24
|
+
ENCRYPTION_KEY = get_encryption_key(APP_DIR)
|
25
|
+
|
26
|
+
# Maximum number of parallel download operations
|
27
|
+
MAX_PARALLEL_DOWNLOADS = 8
|
28
|
+
|
29
|
+
PATH_DELIMITER = "/"
|
30
|
+
|
31
|
+
# UI icons for different file system elements
|
32
|
+
DIRECTORY_ICON = "📁"
|
33
|
+
FILE_ICON = "📄"
|
34
|
+
|
35
|
+
# Action icons
|
36
|
+
DOWNLOAD_ICON = "📥"
|
37
|
+
UPLOAD_ICON = "📤"
|
38
|
+
PREVIEW_ICON = "✨"
|
39
|
+
|
40
|
+
# Time threshold for detecting double-clicks (in seconds)
|
41
|
+
DOUBLE_CLICK_THRESHOLD = 1.5
|
42
|
+
|
43
|
+
# Set of file extensions that are considered text files
|
44
|
+
TEXT_EXTENSIONS = {
|
45
|
+
".txt",
|
46
|
+
".md",
|
47
|
+
".json",
|
48
|
+
".yaml",
|
49
|
+
".yml",
|
50
|
+
".csv",
|
51
|
+
".tsv",
|
52
|
+
".log",
|
53
|
+
".ini",
|
54
|
+
".py",
|
55
|
+
".js",
|
56
|
+
".ts",
|
57
|
+
".html",
|
58
|
+
".css",
|
59
|
+
".xml",
|
60
|
+
".toml",
|
61
|
+
".cfg",
|
62
|
+
".sh",
|
63
|
+
".bat",
|
64
|
+
".java",
|
65
|
+
".c",
|
66
|
+
".cpp",
|
67
|
+
".go",
|
68
|
+
".rs",
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
PAGE_SIZE = 100
|
sourcerer/utils.py
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Generate and store encryption key in a file
|
2
|
+
import os
|
3
|
+
import uuid
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
|
7
|
+
def get_encryption_key(path: Path):
|
8
|
+
"""
|
9
|
+
Get the encryption key from a file or generate a new one if the file doesn't exist.
|
10
|
+
|
11
|
+
path (Path): The path to the file where the encryption key is stored.
|
12
|
+
Returns:
|
13
|
+
str: The encryption key
|
14
|
+
"""
|
15
|
+
|
16
|
+
key_file_path = path / "encryption_key"
|
17
|
+
|
18
|
+
# If key file exists, read the key from it
|
19
|
+
if os.path.exists(key_file_path):
|
20
|
+
with open(key_file_path, "r") as f:
|
21
|
+
return f.read().strip()
|
22
|
+
|
23
|
+
# Otherwise, generate a new key and store it
|
24
|
+
|
25
|
+
# Create directory if it doesn't exist
|
26
|
+
os.makedirs(os.path.dirname(key_file_path), exist_ok=True)
|
27
|
+
|
28
|
+
new_key = str(uuid.uuid4())
|
29
|
+
with open(key_file_path, "w") as f:
|
30
|
+
f.write(new_key)
|
31
|
+
|
32
|
+
return new_key
|