data-sourcerer 0.4.0__py3-none-any.whl → 0.5.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.4.0.dist-info → data_sourcerer-0.5.0.dist-info}/METADATA +9 -8
- {data_sourcerer-0.4.0.dist-info → data_sourcerer-0.5.0.dist-info}/RECORD +42 -23
- sourcerer/__init__.py +3 -1
- sourcerer/domain/package_meta/__init__.py +0 -0
- sourcerer/domain/package_meta/entities.py +9 -0
- sourcerer/domain/package_meta/services.py +9 -0
- sourcerer/domain/settings/__init__.py +0 -0
- sourcerer/domain/settings/entities.py +11 -0
- sourcerer/domain/settings/repositories.py +20 -0
- sourcerer/domain/settings/services.py +19 -0
- sourcerer/infrastructure/db/models.py +23 -0
- sourcerer/infrastructure/package_meta/__init__.py +0 -0
- sourcerer/infrastructure/package_meta/services.py +26 -0
- sourcerer/infrastructure/settings/__init__.py +0 -0
- sourcerer/infrastructure/settings/repositories.py +59 -0
- sourcerer/infrastructure/settings/services.py +16 -0
- sourcerer/infrastructure/storage_provider/services/gcp.py +0 -1
- sourcerer/infrastructure/utils.py +1 -0
- sourcerer/presentation/di_container.py +13 -0
- sourcerer/presentation/screens/about/__init__.py +0 -0
- sourcerer/presentation/screens/about/main.py +60 -0
- sourcerer/presentation/screens/about/styles.tcss +32 -0
- sourcerer/presentation/screens/file_system_finder/__init__.py +0 -0
- sourcerer/presentation/screens/main/main.py +89 -6
- sourcerer/presentation/screens/main/styles.tcss +13 -4
- sourcerer/presentation/screens/main/widgets/storage_list_sidebar.py +102 -18
- sourcerer/presentation/screens/provider_creds_list/main.py +14 -4
- sourcerer/presentation/screens/provider_creds_list/styles.tcss +9 -0
- sourcerer/presentation/screens/settings/__init__.py +0 -0
- sourcerer/presentation/screens/settings/main.py +70 -0
- sourcerer/presentation/screens/settings/styles.tcss +44 -0
- sourcerer/presentation/screens/shared/widgets/button.py +11 -0
- sourcerer/presentation/screens/shared/widgets/labeled_input.py +1 -3
- sourcerer/presentation/screens/storage_action_progress/main.py +1 -2
- sourcerer/presentation/screens/storages_list/main.py +15 -4
- sourcerer/presentation/screens/storages_list/styles.tcss +7 -0
- sourcerer/presentation/settings.py +1 -0
- sourcerer/presentation/utils.py +1 -0
- sourcerer/utils.py +19 -1
- {data_sourcerer-0.4.0.dist-info → data_sourcerer-0.5.0.dist-info}/WHEEL +0 -0
- {data_sourcerer-0.4.0.dist-info → data_sourcerer-0.5.0.dist-info}/entry_points.txt +0 -0
- {data_sourcerer-0.4.0.dist-info → data_sourcerer-0.5.0.dist-info}/licenses/LICENSE +0 -0
sourcerer/presentation/utils.py
CHANGED
@@ -4,6 +4,7 @@ Utility functions for the presentation layer.
|
|
4
4
|
This module provides helper functions for the presentation layer,
|
5
5
|
particularly for retrieving and initializing storage provider services.
|
6
6
|
"""
|
7
|
+
|
7
8
|
from dependency_injector.wiring import Provide
|
8
9
|
|
9
10
|
from sourcerer.domain.access_credentials.repositories import BaseCredentialsRepository
|
sourcerer/utils.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
import contextlib
|
2
2
|
import os
|
3
3
|
import uuid
|
4
4
|
from pathlib import Path
|
5
5
|
|
6
|
+
import requests
|
7
|
+
|
6
8
|
|
7
9
|
def get_encryption_key(path: Path) -> str:
|
8
10
|
"""
|
@@ -30,3 +32,19 @@ def get_encryption_key(path: Path) -> str:
|
|
30
32
|
f.write(new_key)
|
31
33
|
|
32
34
|
return new_key
|
35
|
+
|
36
|
+
|
37
|
+
def get_last_package_version(name):
|
38
|
+
"""
|
39
|
+
Fetch the latest version of a package from PyPI.
|
40
|
+
Args:
|
41
|
+
name (str): The name of the package.
|
42
|
+
Returns:
|
43
|
+
str: The latest version of the package, or None if an error occurs.
|
44
|
+
"""
|
45
|
+
with contextlib.suppress(Exception):
|
46
|
+
url = f"https://pypi.org/pypi/{name}/json"
|
47
|
+
response = requests.get(url, timeout=5)
|
48
|
+
response.raise_for_status()
|
49
|
+
return response.json()["info"]["version"]
|
50
|
+
return None
|
File without changes
|
File without changes
|
File without changes
|