Skip to content

Commit 67057ad

Browse files
reformat with ruff
1 parent 5725c92 commit 67057ad

34 files changed

Lines changed: 2737 additions & 6948 deletions

dropbox/account.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
553553
"other": AccountPhotoGetError._other_validator,
554554
}
555555

556-
AccountPhotoGetError.account_photo_missing = AccountPhotoGetError(
557-
"account_photo_missing"
558-
)
556+
AccountPhotoGetError.account_photo_missing = AccountPhotoGetError("account_photo_missing")
559557
AccountPhotoGetError.expected_account_photo_missing = AccountPhotoGetError(
560558
"expected_account_photo_missing"
561559
)

dropbox/async_.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ def __init__(self, async_job_id=None):
127127
async_job_id = bb.Attribute("async_job_id")
128128

129129
def _process_custom_annotations(self, annotation_type, field_path, processor):
130-
super(PollArg, self)._process_custom_annotations(
131-
annotation_type, field_path, processor
132-
)
130+
super(PollArg, self)._process_custom_annotations(annotation_type, field_path, processor)
133131

134132

135133
PollArg_validator = bv.Struct(PollArg)
@@ -253,9 +251,7 @@ def is_other(self):
253251
return self._tag == "other"
254252

255253
def _process_custom_annotations(self, annotation_type, field_path, processor):
256-
super(PollError, self)._process_custom_annotations(
257-
annotation_type, field_path, processor
258-
)
254+
super(PollError, self)._process_custom_annotations(annotation_type, field_path, processor)
259255

260256

261257
PollError_validator = bv.Union(PollError)

dropbox/auth.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ def get_no_permission(self):
146146
return self._value
147147

148148
def _process_custom_annotations(self, annotation_type, field_path, processor):
149-
super(AccessError, self)._process_custom_annotations(
150-
annotation_type, field_path, processor
151-
)
149+
super(AccessError, self)._process_custom_annotations(annotation_type, field_path, processor)
152150

153151

154152
AccessError_validator = bv.Union(AccessError)
@@ -285,9 +283,7 @@ def get_missing_scope(self):
285283
return self._value
286284

287285
def _process_custom_annotations(self, annotation_type, field_path, processor):
288-
super(AuthError, self)._process_custom_annotations(
289-
annotation_type, field_path, processor
290-
)
286+
super(AuthError, self)._process_custom_annotations(annotation_type, field_path, processor)
291287

292288

293289
AuthError_validator = bv.Union(AuthError)
@@ -866,9 +862,7 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
866862
"other": TokenFromOAuth1Error._other_validator,
867863
}
868864

869-
TokenFromOAuth1Error.invalid_oauth1_token_info = TokenFromOAuth1Error(
870-
"invalid_oauth1_token_info"
871-
)
865+
TokenFromOAuth1Error.invalid_oauth1_token_info = TokenFromOAuth1Error("invalid_oauth1_token_info")
872866
TokenFromOAuth1Error.app_id_mismatch = TokenFromOAuth1Error("app_id_mismatch")
873867
TokenFromOAuth1Error.other = TokenFromOAuth1Error("other")
874868

@@ -880,13 +874,9 @@ def _process_custom_annotations(self, annotation_type, field_path, processor):
880874

881875
TokenScopeError.required_scope.validator = bv.String()
882876
TokenScopeError._all_field_names_ = set(["required_scope"])
883-
TokenScopeError._all_fields_ = [
884-
("required_scope", TokenScopeError.required_scope.validator)
885-
]
877+
TokenScopeError._all_fields_ = [("required_scope", TokenScopeError.required_scope.validator)]
886878

887-
UnauthorizedAccountIdUsageError.unauthorized_account_ids.validator = bv.List(
888-
bv.String()
889-
)
879+
UnauthorizedAccountIdUsageError.unauthorized_account_ids.validator = bv.List(bv.String())
890880
UnauthorizedAccountIdUsageError._all_field_names_ = set(["unauthorized_account_ids"])
891881
UnauthorizedAccountIdUsageError._all_fields_ = [
892882
(

dropbox/base.py

Lines changed: 20 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ def account_delete_profile_photo(self):
6161
)
6262
return r
6363

64-
def account_get_photo(
65-
self, dbx_account_id, size, circle_crop, expect_account_photo
66-
):
64+
def account_get_photo(self, dbx_account_id, size, circle_crop, expect_account_photo):
6765
"""
6866
This lovely endpoint gets the account photo of a given user.
6967
@@ -93,9 +91,7 @@ def account_get_photo(
9391
<https://docs.python.org/2/library/contextlib.html#contextlib.closing>`_
9492
context manager to ensure this.
9593
"""
96-
arg = account.AccountPhotoGetArg(
97-
dbx_account_id, size, circle_crop, expect_account_photo
98-
)
94+
arg = account.AccountPhotoGetArg(dbx_account_id, size, circle_crop, expect_account_photo)
9995
r = self.request(
10096
account.get_photo,
10197
"account",
@@ -130,9 +126,7 @@ def account_get_photo_to_file(
130126
If this raises, ApiError will contain:
131127
:class:`dropbox.account.AccountPhotoGetError`
132128
"""
133-
arg = account.AccountPhotoGetArg(
134-
dbx_account_id, size, circle_crop, expect_account_photo
135-
)
129+
arg = account.AccountPhotoGetArg(dbx_account_id, size, circle_crop, expect_account_photo)
136130
r = self.request(
137131
account.get_photo,
138132
"account",
@@ -645,9 +639,7 @@ def file_properties_templates_update_for_user(
645639
If this raises, ApiError will contain:
646640
:class:`dropbox.file_properties.ModifyTemplateError`
647641
"""
648-
arg = file_properties.UpdateTemplateArg(
649-
template_id, name, description, add_fields
650-
)
642+
arg = file_properties.UpdateTemplateArg(template_id, name, description, add_fields)
651643
r = self.request(
652644
file_properties.templates_update_for_user,
653645
"file_properties",
@@ -2120,9 +2112,7 @@ def files_get_thumbnail_v2(
21202112
<https://docs.python.org/2/library/contextlib.html#contextlib.closing>`_
21212113
context manager to ensure this.
21222114
"""
2123-
arg = files.ThumbnailV2Arg(
2124-
resource, format, size, mode, quality, exclude_media_info
2125-
)
2115+
arg = files.ThumbnailV2Arg(resource, format, size, mode, quality, exclude_media_info)
21262116
r = self.request(
21272117
files.get_thumbnail_v2,
21282118
"files",
@@ -2179,9 +2169,7 @@ def files_get_thumbnail_to_file_v2(
21792169
If this raises, ApiError will contain:
21802170
:class:`dropbox.files.ThumbnailV2Error`
21812171
"""
2182-
arg = files.ThumbnailV2Arg(
2183-
resource, format, size, mode, quality, exclude_media_info
2184-
)
2172+
arg = files.ThumbnailV2Arg(resource, format, size, mode, quality, exclude_media_info)
21852173
r = self.request(
21862174
files.get_thumbnail_v2,
21872175
"files",
@@ -2535,9 +2523,7 @@ def files_list_revisions(
25352523
If this raises, ApiError will contain:
25362524
:class:`dropbox.files.ListRevisionsError`
25372525
"""
2538-
arg = files.ListRevisionsArg(
2539-
path, mode, limit, before_rev, include_restorable_info
2540-
)
2526+
arg = files.ListRevisionsArg(path, mode, limit, before_rev, include_restorable_info)
25412527
r = self.request(
25422528
files.list_revisions,
25432529
"files",
@@ -2712,9 +2698,7 @@ def files_move_batch(
27122698
)
27132699
return r
27142700

2715-
def files_move_batch_v2(
2716-
self, entries, autorename=False, allow_ownership_transfer=False
2717-
):
2701+
def files_move_batch_v2(self, entries, autorename=False, allow_ownership_transfer=False):
27182702
"""
27192703
Move multiple files or folders to different locations at once in the
27202704
user's Dropbox. Note that we do not currently support case-only
@@ -2828,9 +2812,7 @@ def files_paper_create(self, f, path, import_format):
28282812
)
28292813
return r
28302814

2831-
def files_paper_update(
2832-
self, f, path, import_format, doc_update_policy, paper_revision=None
2833-
):
2815+
def files_paper_update(self, f, path, import_format, doc_update_policy, paper_revision=None):
28342816
"""
28352817
Updates an existing Paper doc with the provided content.
28362818
@@ -2856,9 +2838,7 @@ def files_paper_update(
28562838
If this raises, ApiError will contain:
28572839
:class:`dropbox.files.PaperUpdateError`
28582840
"""
2859-
arg = files.PaperUpdateArg(
2860-
path, import_format, doc_update_policy, paper_revision
2861-
)
2841+
arg = files.PaperUpdateArg(path, import_format, doc_update_policy, paper_revision)
28622842
r = self.request(
28632843
files.paper_update,
28642844
"files",
@@ -3077,9 +3057,7 @@ def files_save_url_check_job_status(self, async_job_id):
30773057
)
30783058
return r
30793059

3080-
def files_search(
3081-
self, path, query, start=0, max_results=100, mode=files.SearchMode.filename
3082-
):
3060+
def files_search(self, path, query, start=0, max_results=100, mode=files.SearchMode.filename):
30833061
"""
30843062
Searches for files and folders. Note: Recent changes will be reflected
30853063
in search results within a few seconds and older revisions of existing
@@ -3626,9 +3604,7 @@ def files_upload_session_finish_batch_check(self, async_job_id):
36263604
)
36273605
return r
36283606

3629-
def files_upload_session_start(
3630-
self, f, close=False, session_type=None, content_hash=None
3631-
):
3607+
def files_upload_session_start(self, f, close=False, session_type=None, content_hash=None):
36323608
"""
36333609
Upload sessions allow you to upload a single file in one or more
36343610
requests, for example where the size of the file is greater than 150
@@ -4117,9 +4093,7 @@ def paper_docs_list(
41174093
"docs/list is deprecated.",
41184094
DeprecationWarning,
41194095
)
4120-
arg = paper.ListPaperDocsArgs(
4121-
filter_by, sort_by, sort_order, limit, stop_at_date
4122-
)
4096+
arg = paper.ListPaperDocsArgs(filter_by, sort_by, sort_order, limit, stop_at_date)
41234097
r = self.request(
41244098
paper.docs_list,
41254099
"paper",
@@ -4308,9 +4282,7 @@ def paper_docs_update(self, f, doc_id, doc_update_policy, revision, import_forma
43084282
"docs/update is deprecated.",
43094283
DeprecationWarning,
43104284
)
4311-
arg = paper.PaperDocUpdateArgs(
4312-
doc_id, doc_update_policy, revision, import_format
4313-
)
4285+
arg = paper.PaperDocUpdateArgs(doc_id, doc_update_policy, revision, import_format)
43144286
r = self.request(
43154287
paper.docs_update,
43164288
"paper",
@@ -4531,9 +4503,7 @@ def paper_folders_create(self, name, parent_folder_id=None, is_team_folder=None)
45314503
# ------------------------------------------
45324504
# Routes in riviera namespace
45334505

4534-
def riviera_get_markdown_async(
4535-
self, file_id_or_url=None, enable_ocr=False, embed_images=False
4536-
):
4506+
def riviera_get_markdown_async(self, file_id_or_url=None, enable_ocr=False, embed_images=False):
45374507
"""
45384508
Asynchronous document-to-markdown conversion for supported file formats.
45394509
@@ -5230,9 +5200,7 @@ def sharing_get_shared_links(self, path=None):
52305200
)
52315201
return r
52325202

5233-
def sharing_list_file_members(
5234-
self, file, actions=None, include_inherited=True, limit=100
5235-
):
5203+
def sharing_list_file_members(self, file, actions=None, include_inherited=True, limit=100):
52365204
"""
52375205
Use to obtain the members who have been invited to a file, both
52385206
inherited and uninherited members.
@@ -5325,9 +5293,7 @@ def sharing_list_file_members_continue(self, cursor):
53255293
)
53265294
return r
53275295

5328-
def sharing_list_folder_members(
5329-
self, shared_folder_id, actions=None, limit=1000, path=None
5330-
):
5296+
def sharing_list_folder_members(self, shared_folder_id, actions=None, limit=1000, path=None):
53315297
"""
53325298
Returns shared folder membership by its folder ID.
53335299
@@ -5583,9 +5549,7 @@ def sharing_list_shared_links(self, path=None, cursor=None, direct_only=None):
55835549
)
55845550
return r
55855551

5586-
def sharing_modify_shared_link_settings(
5587-
self, url, settings, remove_expiration=False
5588-
):
5552+
def sharing_modify_shared_link_settings(self, url, settings, remove_expiration=False):
55895553
"""
55905554
Modify the shared link's settings. If the requested visibility conflict
55915555
with the shared links policy of the team or the shared folder (in case
@@ -5696,9 +5660,7 @@ def sharing_relinquish_file_membership(self, file):
56965660
)
56975661
return None
56985662

5699-
def sharing_relinquish_folder_membership(
5700-
self, shared_folder_id, leave_a_copy=False
5701-
):
5663+
def sharing_relinquish_folder_membership(self, shared_folder_id, leave_a_copy=False):
57025664
"""
57035665
The current user relinquishes their membership in the designated shared
57045666
folder and will no longer have access to the folder. A folder owner
@@ -6108,9 +6070,7 @@ def sharing_update_file_policy(
61086070
If this raises, ApiError will contain:
61096071
:class:`dropbox.sharing.UpdateFilePolicyError`
61106072
"""
6111-
arg = sharing.UpdateFilePolicyArg(
6112-
file, actions, link_settings, viewer_info_policy
6113-
)
6073+
arg = sharing.UpdateFilePolicyArg(file, actions, link_settings, viewer_info_policy)
61146074
r = self.request(
61156075
sharing.update_file_policy,
61166076
"sharing",

dropbox/base_team.py

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ def file_properties_templates_update_for_team(
183183
If this raises, ApiError will contain:
184184
:class:`dropbox.file_properties.ModifyTemplateError`
185185
"""
186-
arg = file_properties.UpdateTemplateArg(
187-
template_id, name, description, add_fields
188-
)
186+
arg = file_properties.UpdateTemplateArg(template_id, name, description, add_fields)
189187
r = self.request(
190188
file_properties.templates_update_for_team,
191189
"file_properties",
@@ -731,9 +729,7 @@ def team_groups_members_remove(self, group, users, return_members=True):
731729
)
732730
return r
733731

734-
def team_groups_members_set_access_type(
735-
self, group, user, access_type, return_members=True
736-
):
732+
def team_groups_members_set_access_type(self, group, user, access_type, return_members=True):
737733
"""
738734
Sets a member's access type in a group. Permission : Team member
739735
management.
@@ -754,9 +750,7 @@ def team_groups_members_set_access_type(
754750
If this raises, ApiError will contain:
755751
:class:`dropbox.team.GroupMemberSetAccessTypeError`
756752
"""
757-
arg = team.GroupMembersSetAccessTypeArg(
758-
group, user, access_type, return_members
759-
)
753+
arg = team.GroupMembersSetAccessTypeArg(group, user, access_type, return_members)
760754
r = self.request(
761755
team.groups_members_set_access_type,
762756
"team",
@@ -840,9 +834,7 @@ def team_legal_holds_create_policy(
840834
If this raises, ApiError will contain:
841835
:class:`dropbox.team.LegalHoldsPolicyCreateError`
842836
"""
843-
arg = team.LegalHoldsPolicyCreateArg(
844-
name, members, description, start_date, end_date
845-
)
837+
arg = team.LegalHoldsPolicyCreateArg(name, members, description, start_date, end_date)
846838
r = self.request(
847839
team.legal_holds_create_policy,
848840
"team",
@@ -982,9 +974,7 @@ def team_legal_holds_release_policy(self, id):
982974
)
983975
return None
984976

985-
def team_legal_holds_update_policy(
986-
self, id, name=None, description=None, members=None
987-
):
977+
def team_legal_holds_update_policy(self, id, name=None, description=None, members=None):
988978
"""
989979
Updates a legal hold. Note: Legal Holds is a paid add-on. Not all teams
990980
have the feature. Permission : Team member file access.
@@ -1102,9 +1092,7 @@ def team_linked_apps_list_team_linked_apps(self, cursor=None):
11021092
)
11031093
return r
11041094

1105-
def team_linked_apps_revoke_linked_app(
1106-
self, app_id, team_member_id, keep_app_folder=True
1107-
):
1095+
def team_linked_apps_revoke_linked_app(self, app_id, team_member_id, keep_app_folder=True):
11081096
"""
11091097
Revoke a linked application of the team member.
11101098
@@ -1703,9 +1691,7 @@ def team_members_list_continue_v2(self, cursor):
17031691
)
17041692
return r
17051693

1706-
def team_members_move_former_member_files(
1707-
self, user, transfer_dest_id, transfer_admin_id
1708-
):
1694+
def team_members_move_former_member_files(self, user, transfer_dest_id, transfer_admin_id):
17091695
"""
17101696
Moves removed member's files to a different member. This endpoint
17111697
initiates an asynchronous job. To obtain the final result of the job,
@@ -1945,9 +1931,7 @@ def team_members_secondary_emails_delete(self, emails_to_delete):
19451931
)
19461932
return r
19471933

1948-
def team_members_secondary_emails_resend_verification_emails(
1949-
self, emails_to_resend
1950-
):
1934+
def team_members_secondary_emails_resend_verification_emails(self, emails_to_resend):
19511935
"""
19521936
Resend secondary email verification emails. Permission : Team member
19531937
management.

0 commit comments

Comments
 (0)