Skip to content

Sourcery refactored master branch - #2

Merged
daedalus merged 1 commit into
masterfrom
sourcery/master
Jan 9, 2024
Merged

Sourcery refactored master branch#2
daedalus merged 1 commit into
masterfrom
sourcery/master

Conversation

@sourcery-ai

Copy link
Copy Markdown

Branch master refactored by Sourcery.

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

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 master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai
sourcery-aiBot requested a review from daedalusJanuary 9, 2024 02:54
Comment threadtest.py

def get_my_passwords(passbolt_obj):
result = list()
result = []

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function get_my_passwords refactored with the following changes:

Comment threadtest.py
Comment on lines -27 to +26
result = list()
result = []

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function get_passwords_basic refactored with the following changes:

if return_response_object:
return r
return r.json()
return r if return_response_object else r.json()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function APIClient.get refactored with the following changes:

Comment on lines -172 to +170
if return_response_object:
return r
return r.json()
return r if return_response_object else r.json()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function APIClient.put refactored with the following changes:

Comment on lines -183 to +179
if return_response_object:
return r
return r.json()
return r if return_response_object else r.json()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function APIClient.post refactored with the following changes:

Comment on lines -250 to +247
url_params = "?" + url_params
response = self.get("/resources.json" + url_params)
url_params = f"?{url_params}"
response = self.get(f"/resources.json{url_params}")
assert "body" in response.keys(), f"Key 'body' not found in response keys: {response.keys()}"
resources = response["body"]
for resource in resources:
yield resource
yield from response["body"]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function PassboltAPI.iterate_resources refactored with the following changes:

Comment on lines -264 to +257
url_params = "?" + url_params
response = self.get("/folders.json" + url_params)
url_params = f"?{url_params}"
response = self.get(f"/folders.json{url_params}")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function PassboltAPI.list_resources refactored with the following changes:

Comment on lines -295 to +287
response = self.get(f"/users.json", params=params)
response = self.get("/users.json", params=params)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function PassboltAPI.list_users refactored with the following changes:

Comment on lines -468 to +464
r = self.put(f"/resources/{resource_id}.json", payload, return_response_object=True)
return r
return self.put(
f"/resources/{resource_id}.json",
payload,
return_response_object=True,
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function PassboltAPI.update_resource refactored with the following changes:

@daedalus
daedalus merged commit c63a575 into masterJan 9, 2024
Sign up for freeto 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.

1 participant

@daedalus