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-2861: Fix behavior when not entering the correct URL format (Sourcery refactored) #4232

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Oct 11, 2023

Pull Request #4231 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-format branch, then run:

git fetch origin sourcery/wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-format
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from gitofanindya October 11, 2023 04:45
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Sourcery AI seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Attention: 41 lines in your changes are missing coverage. Please review.

Comparison is base (5389b4d) 48.82% compared to head (244c981) 49.08%.

Additional details and impacted files
@@                                            Coverage Diff                                             @@
##           wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-format    #4232      +/-   ##
==========================================================================================================
+ Coverage                                                                   48.82%   49.08%   +0.25%     
==========================================================================================================
  Files                                                                          94       94              
  Lines                                                                       15680    15645      -35     
==========================================================================================================
+ Hits                                                                         7656     7679      +23     
+ Misses                                                                       8024     7966      -58     
Flag Coverage Δ
functional 38.01% <0.00%> (+0.23%) ⬆️
integration 2.07% <0.00%> (+<0.01%) ⬆️
unit 37.48% <0.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
nxdrive/gui/api.py 29.08% <0.00%> (+1.50%) ⬆️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-format branch 4 times, most recently from 40695c1 to e2cb8b8 Compare October 17, 2023 04:09
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-format branch 8 times, most recently from ebc61c3 to 992b39c Compare October 30, 2023 05:59
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-format branch from 992b39c to a4c58b8 Compare November 8, 2023 04:59
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-format branch from a4c58b8 to 244c981 Compare November 8, 2023 06:36
Comment on lines -122 to -125
engine = self._manager.engines.get(uid)
if not engine:
if engine := self._manager.engines.get(uid):
return [s.export() for s in engine.dao.get_last_files(number)]
else:
return []
return [s.export() for s in engine.dao.get_last_files(number)]
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 QMLDriveApi.get_last_files refactored with the following changes:

Comment on lines -130 to +134
count = 0
engine = self._manager.engines.get(uid)
if engine:
count = engine.dao.get_last_files_count(duration=60)
return count
return (
engine.dao.get_last_files_count(duration=60)
if (engine := self._manager.engines.get(uid))
else 0
)
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 QMLDriveApi.get_last_files_count refactored with the following changes:

engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.get_active_sessions_count refactored with the following changes:

Comment on lines -231 to +230
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.get_completed_sessions_count refactored with the following changes:

Comment on lines -252 to -257
engine = self._manager.engines.get(engine_uid)
if not engine:
if engine := self._manager.engines.get(engine_uid):
engine.dao.pause_transfer(
nature, transfer_uid, progress, is_direct_transfer=is_direct_transfer
)
else:
return
engine.dao.pause_transfer(
nature, transfer_uid, progress, is_direct_transfer=is_direct_transfer
)
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 QMLDriveApi.pause_transfer refactored with the following changes:

Comment on lines -386 to -390
engine = self._manager.engines.get(uid)
if not engine:
if engine := self._manager.engines.get(uid):
self.application.show_server_folders(engine, None)
else:
return

self.application.show_server_folders(engine, None)
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 QMLDriveApi.open_server_folders refactored with the following changes:

Comment on lines -400 to +399
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.open_remote_server refactored with the following changes:

else:
engine = self._manager.engines.get(uid)
if engine:
filepath = engine.local.abspath(filepath)
self._manager.open_local_file(filepath)
elif engine := self._manager.engines.get(uid):
filepath = engine.local.abspath(filepath)
self._manager.open_local_file(filepath)
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 QMLDriveApi.open_local refactored with the following changes:

Comment on lines -451 to +447
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.show_conflicts_resolution refactored with the following changes:

Comment on lines -579 to +574
result = {k: v for k, v in sorted(result.items(), key=lambda item: item[1])}
result = dict(sorted(result.items(), key=lambda item: item[1]))
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 QMLDriveApi._balance_percents refactored with the following changes:

Comment on lines -641 to +636
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.filters_dialog refactored with the following changes:

Comment on lines -876 to +870
error = self._manager.set_proxy(proxy)
if error:
if error := self._manager.set_proxy(proxy):
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 QMLDriveApi.set_proxy_settings refactored with the following changes:

Comment on lines -1051 to +1048
count = 0
engine = self._manager.engines.get(uid)
if engine:
count = engine.dao.get_syncing_count()
return count
return (
engine.dao.get_syncing_count()
if (engine := self._manager.engines.get(uid))
else 0
)
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 QMLDriveApi.get_syncing_count refactored with the following changes:

Comment on lines -1061 to +1054
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.resolve_with_local refactored with the following changes:

Comment on lines -1067 to +1059
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.resolve_with_remote refactored with the following changes:

Comment on lines -1073 to +1064
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.retry_pair refactored with the following changes:

Comment on lines -1079 to +1069
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.ignore_pair refactored with the following changes:

Comment on lines -1087 to +1076
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.open_remote refactored with the following changes:

Comment on lines -1099 to +1087
engine = self._manager.engines.get(uid)
if engine:
if engine := self._manager.engines.get(uid):
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 QMLDriveApi.open_remote_document refactored with the following changes:

@gitofanindya gitofanindya deleted the branch wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-format January 17, 2024 04:21
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