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) #4338

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Nov 20, 2023

Pull Request #4337 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-formatt branch, then run:

git fetch origin sourcery/wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-formatt
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 November 20, 2023 08:14
@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.

1 similar comment
@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.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

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

Comparison is base (58b527a) 48.99% compared to head (4fe67fb) 49.10%.

Files Patch % Lines
nxdrive/gui/api.py 0.00% 40 Missing ⚠️
Additional details and impacted files
@@                                             Coverage Diff                                             @@
##           wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-formatt    #4338      +/-   ##
===========================================================================================================
+ Coverage                                                                    48.99%   49.10%   +0.10%     
===========================================================================================================
  Files                                                                           94       94              
  Lines                                                                        15680    15645      -35     
===========================================================================================================
  Hits                                                                          7683     7683              
+ Misses                                                                        7997     7962      -35     
Flag Coverage Δ
functional 38.03% <0.00%> (+0.08%) ⬆️
integration 2.07% <0.00%> (+<0.01%) ⬆️
unit 37.49% <0.00%> (+0.08%) ⬆️

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

☔ 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-formatt branch from 2d5d618 to 7d6c48b Compare November 20, 2023 08:23
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-formatt branch from 7d6c48b to 4fe67fb Compare November 20, 2023 10:12
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 -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:

Base automatically changed from wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-formatt to master November 21, 2023 07:13
@sourcery-ai sourcery-ai bot closed this Nov 21, 2023
@sourcery-ai sourcery-ai bot deleted the sourcery/wip-NXDRIVE-2861-Fix-behavior-when-not-entering-the-correct-URL-formatt branch November 21, 2023 07:13
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