data-sourcerer 0.2.2__py3-none-any.whl → 0.3.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.
Files changed (44) hide show
  1. {data_sourcerer-0.2.2.dist-info → data_sourcerer-0.3.0.dist-info}/METADATA +1 -1
  2. {data_sourcerer-0.2.2.dist-info → data_sourcerer-0.3.0.dist-info}/RECORD +43 -29
  3. sourcerer/__init__.py +1 -1
  4. sourcerer/domain/access_credentials/entities.py +3 -1
  5. sourcerer/domain/access_credentials/repositories.py +1 -1
  6. sourcerer/domain/storage/__init__.py +0 -0
  7. sourcerer/domain/storage/entities.py +27 -0
  8. sourcerer/domain/storage/repositories.py +31 -0
  9. sourcerer/infrastructure/access_credentials/repositories.py +3 -2
  10. sourcerer/infrastructure/access_credentials/services.py +9 -25
  11. sourcerer/infrastructure/db/models.py +33 -2
  12. sourcerer/infrastructure/storage/__init__.py +0 -0
  13. sourcerer/infrastructure/storage/repositories.py +72 -0
  14. sourcerer/infrastructure/storage/services.py +37 -0
  15. sourcerer/infrastructure/storage_provider/services/gcp.py +1 -1
  16. sourcerer/infrastructure/utils.py +2 -1
  17. sourcerer/presentation/di_container.py +15 -0
  18. sourcerer/presentation/screens/file_system_finder/main.py +7 -6
  19. sourcerer/presentation/screens/file_system_finder/widgets/file_system_navigator.py +16 -13
  20. sourcerer/presentation/screens/main/main.py +63 -8
  21. sourcerer/presentation/screens/main/messages/select_storage_item.py +1 -0
  22. sourcerer/presentation/screens/main/mixins/resize_containers_watcher_mixin.py +2 -1
  23. sourcerer/presentation/screens/main/widgets/storage_content.py +191 -85
  24. sourcerer/presentation/screens/main/widgets/storage_list_sidebar.py +99 -31
  25. sourcerer/presentation/screens/preview_content/main.py +15 -3
  26. sourcerer/presentation/screens/provider_creds_list/main.py +29 -8
  27. sourcerer/presentation/screens/provider_creds_registration/main.py +7 -4
  28. sourcerer/presentation/screens/shared/widgets/labeled_input.py +2 -2
  29. sourcerer/presentation/screens/shared/widgets/spinner.py +57 -0
  30. sourcerer/presentation/screens/storage_action_progress/main.py +7 -11
  31. sourcerer/presentation/screens/storages_list/__init__.py +0 -0
  32. sourcerer/presentation/screens/storages_list/main.py +180 -0
  33. sourcerer/presentation/screens/storages_list/messages/__init__.py +0 -0
  34. sourcerer/presentation/screens/storages_list/messages/reload_storages_request.py +8 -0
  35. sourcerer/presentation/screens/storages_list/styles.tcss +55 -0
  36. sourcerer/presentation/screens/storages_registration/__init__.py +0 -0
  37. sourcerer/presentation/screens/storages_registration/main.py +100 -0
  38. sourcerer/presentation/screens/storages_registration/styles.tcss +41 -0
  39. sourcerer/presentation/settings.py +29 -16
  40. sourcerer/presentation/utils.py +9 -1
  41. sourcerer/presentation/screens/shared/widgets/loader.py +0 -31
  42. {data_sourcerer-0.2.2.dist-info → data_sourcerer-0.3.0.dist-info}/WHEEL +0 -0
  43. {data_sourcerer-0.2.2.dist-info → data_sourcerer-0.3.0.dist-info}/entry_points.txt +0 -0
  44. {data_sourcerer-0.2.2.dist-info → data_sourcerer-0.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,41 @@
1
+
2
+ Container {
3
+ height: auto;
4
+ }
5
+
6
+ Label {
7
+ padding-left: 1;
8
+ }
9
+
10
+ StoragesRegistrationScreen {
11
+ align: center middle;
12
+ content-align: center top;
13
+
14
+ & > #StoragesRegistrationScreen {
15
+ padding: 1 2 0 2;
16
+ margin: 0 0;
17
+ width: 70;
18
+ height: 17;
19
+ border: solid $secondary-background;
20
+
21
+ & > #settings {
22
+ width: 100%;
23
+ height: 11;
24
+
25
+ & > .form_label {
26
+ padding-left: 1;
27
+ margin-bottom: 1;
28
+
29
+ }
30
+
31
+ & > #credentials_fields_container {
32
+ margin-top: 2;
33
+ padding-left: 2;
34
+ }
35
+
36
+ & > Select {
37
+ margin-bottom: 1;
38
+ }
39
+ }
40
+ }
41
+ }
@@ -3,29 +3,42 @@
3
3
  This module contains various configuration constants and settings used throughout
4
4
  the application, including UI elements and display configurations.
5
5
  """
6
+ from enum import Enum
6
7
 
7
8
  NO_DATA_LOGO = """
8
- ### ###
9
- ### ###
10
- #### ####
11
- #### ####
12
- #######################
13
- ###### ######### ######
14
- ###### ######### ######
9
+ ### ###
10
+ ### ###
11
+ #### ####
12
+ #### ####
13
+ #######################
14
+ ###### ######### ######
15
+ ###### ######### ######
15
16
  ###################################
16
17
  ###################################
17
18
  ### ####################### ###
18
19
  ### ####################### ###
19
20
  ### ### ### ###
20
- ####### #######
21
- ####### #######
22
-
23
-
24
- ### ## ## #
25
- #### ## #### ###### #### #### #####
26
- ## ## ## ## ## ## ## #### # ####
27
- ## #### ## ## ## ## ## ## # ## ##
28
- ## ## #### ##### ###### ### ### #
21
+ ####### #######
22
+ ####### #######
23
+
24
+
25
+ ### ## ## #
26
+ #### ## #### ###### #### #### #####
27
+ ## ## ## ## ## ## ## #### # ####
28
+ ## #### ## ## ## ## ## ## # ## ##
29
+ ## ## #### ##### ###### ### ### #
29
30
  """
30
31
 
31
32
  MIN_SECTION_DIMENSION = 10
33
+
34
+
35
+ class KeyBindings(Enum):
36
+ """Enum representing key bindings for various actions in the application."""
37
+
38
+ ARROW_DOWN = "down"
39
+ ARROW_UP = "up"
40
+ ARROW_RIGHT = "right"
41
+ ARROW_LEFT = "left"
42
+ ENTER = "enter"
43
+ BACKSPACE = "backspace"
44
+ CTRL = "ctrl"
@@ -4,13 +4,16 @@ 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
+ from dependency_injector.wiring import Provide
7
8
 
9
+ from sourcerer.domain.access_credentials.repositories import BaseCredentialsRepository
8
10
  from sourcerer.domain.storage_provider.services import BaseStorageProviderService
9
11
  from sourcerer.infrastructure.access_credentials.exceptions import CredentialsAuthError
10
12
  from sourcerer.infrastructure.access_credentials.registry import (
11
13
  access_credential_method_registry,
12
14
  )
13
15
  from sourcerer.infrastructure.storage_provider.registry import storage_provider_registry
16
+ from sourcerer.presentation.di_container import DiContainer
14
17
 
15
18
 
16
19
  def get_provider_service_by_access_uuid(
@@ -32,6 +35,9 @@ def get_provider_service_by_access_uuid(
32
35
 
33
36
  def get_provider_service_by_access_credentials(
34
37
  credentials,
38
+ credentials_repo: BaseCredentialsRepository = Provide[
39
+ DiContainer.credentials_repository
40
+ ],
35
41
  ) -> BaseStorageProviderService | None:
36
42
  """
37
43
  Retrieves a storage provider service instance using the given access credentials.
@@ -67,7 +73,9 @@ def get_provider_service_by_access_credentials(
67
73
  return None
68
74
 
69
75
  try:
70
- auth_credentials = credentials_service().authenticate(credentials.credentials)
76
+ auth_credentials = credentials_service(credentials_repo).authenticate(
77
+ credentials.credentials
78
+ )
71
79
  except CredentialsAuthError:
72
80
  return None
73
81
  return provider_service_class(auth_credentials)
@@ -1,31 +0,0 @@
1
- from textual.app import ComposeResult
2
- from textual.containers import Container
3
- from textual.widgets import Static
4
-
5
-
6
- class Loader(Container):
7
- stops = "⣷⣯⣟⡿⢿⣻⣽⣾"
8
- index = 0
9
-
10
- DEFAULT_CSS = """
11
- Loader {
12
- color: #9E53E0;
13
- }
14
- """
15
-
16
- def __init__(self, *args, **kwargs):
17
- self.label = Static(self.stops[self.index])
18
- super().__init__(*args, **kwargs)
19
-
20
- def compose(self) -> ComposeResult:
21
- yield self.label
22
-
23
- def on_mount(self) -> None:
24
- self.auto_refresh = 1 / 10
25
-
26
- def automatic_refresh(self):
27
- self.index += 1
28
- if self.index >= len(self.stops):
29
- self.index = 0
30
- value = self.stops[self.index]
31
- self.label.update(value)