Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jahwag committed Jul 21, 2024
1 parent 668097a commit ad3c5f4
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/claudesync/cli/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def archive(config):
if 1 <= selection <= len(projects):
selected_project = projects[selection - 1]
if click.confirm(
f"Are you sure you want to archive '{selected_project['name']}'?"
f"Are you sure you want to archive '{selected_project['name']}'?"
):
provider.archive_project(active_organization_id, selected_project["id"])
click.echo(f"Project '{selected_project['name']}' has been archived.")
Expand Down
4 changes: 2 additions & 2 deletions src/claudesync/cli/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def sync(config):
active_organization_id, active_project_id, remote_file["uuid"]
)
with open(
os.path.join(local_path, local_file), "r", encoding="utf-8"
os.path.join(local_path, local_file), "r", encoding="utf-8"
) as file:
content = file.read()
provider.upload_file(
Expand All @@ -82,7 +82,7 @@ def sync(config):
else:
click.echo(f"Uploading new file {local_file} to remote...")
with open(
os.path.join(local_path, local_file), "r", encoding="utf-8"
os.path.join(local_path, local_file), "r", encoding="utf-8"
) as file:
content = file.read()
provider.upload_file(
Expand Down
1 change: 1 addition & 0 deletions src/claudesync/provider_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Import other providers here as they are added


def get_provider(provider_name=None, session_key=None):
"""
Retrieve an instance of a provider class based on the provider name and session key.
Expand Down
24 changes: 15 additions & 9 deletions src/claudesync/providers/claude_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,21 @@ def __init__(self, session_key=None):

def _configure_logging(self):
"""
Configures the logging level for the application based on the configuration.
This method sets the global logging configuration to the level specified in the application's configuration.
If the log level is not specified in the configuration, it defaults to "INFO".
It ensures that all log messages across the application are handled at the configured log level.
"""

log_level = self.config.get("log_level", "INFO") # Retrieve log level from config, default to "INFO"
logging.basicConfig(level=getattr(logging, log_level)) # Set global logging configuration
logger.setLevel(getattr(logging, log_level)) # Set logger instance to the specified log level
Configures the logging level for the application based on the configuration.
This method sets the global logging configuration to the level specified in the application's configuration.
If the log level is not specified in the configuration, it defaults to "INFO".
It ensures that all log messages across the application are handled at the configured log level.
"""

log_level = self.config.get(
"log_level", "INFO"
) # Retrieve log level from config, default to "INFO"
logging.basicConfig(
level=getattr(logging, log_level)
) # Set global logging configuration
logger.setLevel(
getattr(logging, log_level)
) # Set logger instance to the specified log level

def login(self):
"""
Expand Down
1 change: 1 addition & 0 deletions src/claudesync/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def validate_and_store_local_path(config):
This function uses `click.prompt` to interact with the user, providing a default path (the current working directory)
and validating the user's input to ensure it meets the criteria for an absolute path to a directory.
"""

def get_default_path():
return os.getcwd()

Expand Down
1 change: 0 additions & 1 deletion tests/cli/test_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import unittest
from unittest.mock import patch, MagicMock
from claudesync.providers.claude_ai import ClaudeAIProvider
from claudesync.exceptions import ProviderError


class TestClaudeAIProvider(unittest.TestCase):
Expand Down
1 change: 0 additions & 1 deletion tests/providers/test_claude_ai.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import unittest
from unittest.mock import patch, MagicMock
from claudesync.providers.claude_ai import ClaudeAIProvider
from claudesync.exceptions import ProviderError


class TestClaudeAIProvider(unittest.TestCase):
Expand Down

0 comments on commit ad3c5f4

Please sign in to comment.