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

NXDRIVE-2854: Take into account ignore suffixes from the server confi… (Sourcery refactored) #4309

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nxdrive/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def validate_use_sentry(value: bool, /) -> bool:


def _validate_deletion_behavior(value: str, /) -> str:
if value in ("unsync", "delete_server"):
if value in {"unsync", "delete_server"}:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function _validate_deletion_behavior refactored with the following changes:

return value
raise ValueError(f"Unknown deletion behavior {value!r}")

Expand All @@ -626,7 +626,7 @@ def validate_tmp_file_limit(value: Union[int, float], /) -> float:

def validate_sync_root_max_level_limits(value: int, /) -> int:
if 0 <= value <= 4:
return int(value)
return value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function validate_sync_root_max_level_limits refactored with the following changes:

raise ValueError("'sync_root_max_level' must be between 0 and 4 (inclusive).")


Expand All @@ -639,7 +639,7 @@ def _callback_synchronization_enabled(new_value: bool) -> None:


# Handler callback for each feature
for feature in vars(Feature).keys():
for feature in vars(Feature):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lines 642-642 refactored with the following changes:

Options.callbacks[f"feature_{feature}"] = CallableFeatureHandler(feature)

Options.callbacks["deletion_behavior"] = lambda v: log.info(
Expand Down
Loading