claudesync 0.3.3__tar.gz → 0.3.4__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.
- {claudesync-0.3.3/src/claudesync.egg-info → claudesync-0.3.4}/PKG-INFO +1 -1
- {claudesync-0.3.3 → claudesync-0.3.4}/pyproject.toml +1 -1
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/cli/project.py +1 -1
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/cli/sync.py +2 -2
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/provider_factory.py +4 -3
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/providers/claude_ai.py +19 -16
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/utils.py +1 -0
- {claudesync-0.3.3 → claudesync-0.3.4/src/claudesync.egg-info}/PKG-INFO +1 -1
- {claudesync-0.3.3 → claudesync-0.3.4}/tests/test_utils.py +2 -1
- {claudesync-0.3.3 → claudesync-0.3.4}/LICENSE +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/README.md +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/setup.cfg +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/setup.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/__init__.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/cli/__init__.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/cli/api.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/cli/main.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/cli/organization.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/config_manager.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/exceptions.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync/providers/__init__.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync.egg-info/SOURCES.txt +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync.egg-info/dependency_links.txt +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync.egg-info/entry_points.txt +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync.egg-info/requires.txt +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/src/claudesync.egg-info/top_level.txt +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/tests/test_config_manager.py +0 -0
- {claudesync-0.3.3 → claudesync-0.3.4}/tests/test_provider_factory.py +0 -0
|
@@ -63,7 +63,7 @@ def archive(config):
|
|
|
63
63
|
if 1 <= selection <= len(projects):
|
|
64
64
|
selected_project = projects[selection - 1]
|
|
65
65
|
if click.confirm(
|
|
66
|
-
|
|
66
|
+
f"Are you sure you want to archive '{selected_project['name']}'?"
|
|
67
67
|
):
|
|
68
68
|
provider.archive_project(active_organization_id, selected_project["id"])
|
|
69
69
|
click.echo(f"Project '{selected_project['name']}' has been archived.")
|
|
@@ -71,7 +71,7 @@ def sync(config):
|
|
|
71
71
|
active_organization_id, active_project_id, remote_file["uuid"]
|
|
72
72
|
)
|
|
73
73
|
with open(
|
|
74
|
-
|
|
74
|
+
os.path.join(local_path, local_file), "r", encoding="utf-8"
|
|
75
75
|
) as file:
|
|
76
76
|
content = file.read()
|
|
77
77
|
provider.upload_file(
|
|
@@ -82,7 +82,7 @@ def sync(config):
|
|
|
82
82
|
else:
|
|
83
83
|
click.echo(f"Uploading new file {local_file} to remote...")
|
|
84
84
|
with open(
|
|
85
|
-
|
|
85
|
+
os.path.join(local_path, local_file), "r", encoding="utf-8"
|
|
86
86
|
) as file:
|
|
87
87
|
content = file.read()
|
|
88
88
|
provider.upload_file(
|
|
@@ -3,6 +3,7 @@ from .providers.claude_ai import ClaudeAIProvider
|
|
|
3
3
|
|
|
4
4
|
# Import other providers here as they are added
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
def get_provider(provider_name=None, session_key=None):
|
|
7
8
|
"""
|
|
8
9
|
Retrieve an instance of a provider class based on the provider name and session key.
|
|
@@ -12,9 +13,9 @@ def get_provider(provider_name=None, session_key=None):
|
|
|
12
13
|
name is specified but not found in the registry, it raises a ValueError. If a session key is provided, it
|
|
13
14
|
is passed to the provider class constructor.
|
|
14
15
|
|
|
15
|
-
Args:
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Args: provider_name (str, optional): The name of the provider to retrieve. If None, returns a list of available
|
|
17
|
+
provider names. session_key (str, optional): The session key to be used by the provider for authentication.
|
|
18
|
+
Defaults to None.
|
|
18
19
|
|
|
19
20
|
Returns:
|
|
20
21
|
object: An instance of the requested provider class if both provider_name and session_key are provided.
|
|
@@ -42,15 +42,21 @@ class ClaudeAIProvider:
|
|
|
42
42
|
|
|
43
43
|
def _configure_logging(self):
|
|
44
44
|
"""
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
Configures the logging level for the application based on the configuration.
|
|
46
|
+
This method sets the global logging configuration to the level specified in the application's configuration.
|
|
47
|
+
If the log level is not specified in the configuration, it defaults to "INFO".
|
|
48
|
+
It ensures that all log messages across the application are handled at the configured log level.
|
|
49
|
+
"""
|
|
50
50
|
|
|
51
|
-
log_level = self.config.get(
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
log_level = self.config.get(
|
|
52
|
+
"log_level", "INFO"
|
|
53
|
+
) # Retrieve log level from config, default to "INFO"
|
|
54
|
+
logging.basicConfig(
|
|
55
|
+
level=getattr(logging, log_level)
|
|
56
|
+
) # Set global logging configuration
|
|
57
|
+
logger.setLevel(
|
|
58
|
+
getattr(logging, log_level)
|
|
59
|
+
) # Set logger instance to the specified log level
|
|
54
60
|
|
|
55
61
|
def login(self):
|
|
56
62
|
"""
|
|
@@ -98,19 +104,16 @@ class ClaudeAIProvider:
|
|
|
98
104
|
Returns:
|
|
99
105
|
list of dict: A list of dictionaries, each containing the 'id' and 'name' of an organization.
|
|
100
106
|
"""
|
|
101
|
-
|
|
102
|
-
if
|
|
103
|
-
"account" not in account_info
|
|
104
|
-
or "memberships" not in account_info["account"]
|
|
105
|
-
):
|
|
107
|
+
organizations = self._make_request("GET", "/organizations")
|
|
108
|
+
if not organizations:
|
|
106
109
|
raise ProviderError("Unable to retrieve organization information")
|
|
107
110
|
|
|
108
111
|
return [
|
|
109
112
|
{
|
|
110
|
-
"id":
|
|
111
|
-
"name":
|
|
113
|
+
"id": org["uuid"],
|
|
114
|
+
"name": org["name"],
|
|
112
115
|
}
|
|
113
|
-
for
|
|
116
|
+
for org in organizations
|
|
114
117
|
]
|
|
115
118
|
|
|
116
119
|
def get_projects(self, organization_id, include_archived=False):
|
|
@@ -242,6 +242,7 @@ def validate_and_store_local_path(config):
|
|
|
242
242
|
This function uses `click.prompt` to interact with the user, providing a default path (the current working directory)
|
|
243
243
|
and validating the user's input to ensure it meets the criteria for an absolute path to a directory.
|
|
244
244
|
"""
|
|
245
|
+
|
|
245
246
|
def get_default_path():
|
|
246
247
|
return os.getcwd()
|
|
247
248
|
|
|
@@ -54,7 +54,8 @@ class TestUtils(unittest.TestCase):
|
|
|
54
54
|
self.assertIn("file1.txt", local_files)
|
|
55
55
|
self.assertIn("file2.py", local_files)
|
|
56
56
|
self.assertIn(os.path.join("subdir", "file3.txt"), local_files)
|
|
57
|
-
|
|
57
|
+
# Ensure ignored files not included
|
|
58
|
+
self.assertEqual(len(local_files), 3)
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
if __name__ == "__main__":
|
|
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
|