Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tickets/SITCOM-1539 #3

Merged
merged 4 commits into from
Sep 27, 2024
Merged

tickets/SITCOM-1539 #3

merged 4 commits into from
Sep 27, 2024

Conversation

fred3m
Copy link
Collaborator

@fred3m fred3m commented Aug 22, 2024

Feature updates and bug fixes.

Comment on lines +43 to +46
base_path
The root directory that shouldn't be escaped.
user_path
List of path components provided by the user.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guess here (and the rest of the file/package) you're not annotating the type in the docstring because it's all mypyed. I guess that's fine, given this isn't DM code, but it's unusual to me, so thought I'd mention/check.

path: list[str]
response_type: str = "directory files"

def build_contents(self, data_center: DataCenter) -> dict:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs?

Comment on lines +106 to +111
except FileOperationError as e:
logging.error(f"File operation error: {str(e)}")
return {"error": str(e)}
except Exception as e:
logging.error(f"Unexpected error: {str(e)}")
return {"error": f"An unexpected error occurred: {str(e)}"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you've thought about this, and really do want to trap basically any errors and have this function never raise (I've not read on yet), but just checking that's right.



@dataclass(kw_only=True)
class CreateDirectoryCommand(BaseCommand):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments on docs + errors here.



@dataclass(kw_only=True)
class RenameFileCommand(BaseCommand):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again.



@dataclass(kw_only=True)
class MoveFileCommand(BaseCommand):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

etc



@dataclass(kw_only=True)
class SaveFileCommand(BaseCommand):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

etc



@dataclass(kw_only=True)
class LoadFileCommand(BaseCommand):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

etc

if TYPE_CHECKING:
from ..data import DataCenter

MAX_FILE_SIZE = 10 * 1024 * 1024 # 10 MB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this?

@@ -218,7 +218,7 @@ def setUp(self):

# Create the datacenter
self.database = ConsDbSchema(schema=schema, engine=engine, join_templates=joins)
self.data_center = DataCenter(schemas={"testdb": self.database})
self.data_center = DataCenter(schemas={"testdb": self.database}, user_path="")

def tearDown(self) -> None:
self.db_file.close()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure what to make of the GHA sadness below, nor how to comment on it on the PR.

@fred3m fred3m merged commit 657a960 into main Sep 27, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants