-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
base_path | ||
The root directory that shouldn't be escaped. | ||
user_path | ||
List of path components provided by the user. |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs?
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)}"} |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
Feature updates and bug fixes.