Skip to content

Commit a59bc5b

Browse files
committed
Jira: Remove unused variable
1 parent d67a3e7 commit a59bc5b

File tree

5 files changed

+41
-24
lines changed

5 files changed

+41
-24
lines changed

atlassian/bitbucket/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ def all_project_repo_hook_settings(self, project_key, start=0, limit=None, filte
561561
:param start:
562562
:param limit: OPTIONAL: The limit of the number of changes to return, this may be restricted by
563563
fixed system limits. Default by built-in method: None
564-
:param filter_type: OPTIONAL: PRE_RECEIVE|POST_RECEIVE if present, controls how repository hooks should be filtered.
564+
:param filter_type: OPTIONAL: PRE_RECEIVE|POST_RECEIVE if present,
565+
controls how repository hooks should be filtered.
565566
:return:
566567
"""
567568
url = self._url_project_repo_hook_settings(project_key)
@@ -1335,7 +1336,8 @@ def all_repo_hook_settings(self, project_key, repository_slug, start=0, limit=No
13351336
:param start:
13361337
:param limit: OPTIONAL: The limit of the number of changes to return, this may be restricted by
13371338
fixed system limits. Default by built-in method: None
1338-
:param filter_type: OPTIONAL: PRE_RECEIVE|POST_RECEIVE if present, controls how repository hooks should be filtered.
1339+
:param filter_type: OPTIONAL: PRE_RECEIVE|POST_RECEIVE if present,
1340+
controls how repository hooks should be filtered.
13391341
:return:
13401342
"""
13411343
url = self._url_repo_hook_settings(project_key, repository_slug)
@@ -2716,11 +2718,14 @@ def download_repo_archive(
27162718
:param project_key:
27172719
:param repository_slug:
27182720
:param dest_fd: a file-like object to which the archive will be written
2719-
:param at: string: Optional, the commit to download an archive of; if not supplied, an archive of the default branch is downloaded
2721+
:param at: string: Optional, the commit to download an archive of; if not supplied,
2722+
an archive of the default branch is downloaded
27202723
:param filename: string: Optional, a filename to include the "Content-Disposition" header
2721-
:param format: string: Optional, the format to stream the archive in; must be one of: zip, tar, tar.gz or tgz. If not specified, then the archive will be in zip format.
2724+
:param format: string: Optional, the format to stream the archive in; must be one of: zip, tar, tar.gz or tgz.
2725+
If not specified, then the archive will be in zip format.
27222726
:param path: string: Optional, path to include in the streamed archive
2723-
:param prefix: string: Optional, a prefix to apply to all entries in the streamed archive; if the supplied prefix does not end with a trailing /, one will be added automatically
2727+
:param prefix: string: Optional, a prefix to apply to all entries in the streamed archive;
2728+
if the supplied prefix does not end with a trailing /, one will be added automatically
27242729
:param chunk_size: int: Optional, download chunk size. Defeault is 128
27252730
"""
27262731
url = "{}/archive".format(self._url_repo(project_key, repository_slug))

atlassian/bitbucket/cloud/repositories/__init__.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def get(self, workspace, repo_slug):
7676
7777
:return: The requested Repository object
7878
79-
API docs: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-get
79+
API docs:
80+
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-get
8081
"""
8182
return self._get_object(super(Repositories, self).get("{}/{}".format(workspace, repo_slug)))
8283

@@ -107,7 +108,8 @@ def create(self, repo_slug, project_key=None, is_private=None, fork_policy=None)
107108
108109
:return: The created project object
109110
110-
API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#post
111+
API docs:
112+
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#post
111113
"""
112114

113115
data = {"scm": "git"}
@@ -159,7 +161,8 @@ def get(self, repository, by="slug"):
159161
160162
:return: The requested Repository object
161163
162-
API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#get
164+
API docs:
165+
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#get
163166
"""
164167
if by == "slug":
165168
return self._get_object(super(WorkspaceRepositories, self).get(repository))
@@ -181,7 +184,8 @@ def exists(self, repository, by="slug"):
181184
182185
:return: True if the repository exists
183186
184-
API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#get
187+
API docs:
188+
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#get
185189
"""
186190
exists = False
187191
try:
@@ -209,7 +213,8 @@ def each(self, sort=None):
209213
210214
:return: A generator for the repository objects
211215
212-
API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/workspaces/%7Bworkspace%7D/projects/%7Bproject_key%7D#get
216+
API docs:
217+
https://developer.atlassian.com/bitbucket/api/2/reference/resource/workspaces/%7Bworkspace%7D/projects/%7Bproject_key%7D#get
213218
"""
214219
params = {}
215220
if sort is not None:
@@ -226,7 +231,8 @@ def get(self, repository, by="slug"):
226231
227232
:return: The requested Repository object
228233
229-
API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/workspaces/%7Bworkspace%7D/projects/%7Bproject_key%7D#get
234+
API docs:
235+
https://developer.atlassian.com/bitbucket/api/2/reference/resource/workspaces/%7Bworkspace%7D/projects/%7Bproject_key%7D#get
230236
"""
231237
if by not in ("slug", "name"):
232238
ValueError("Unknown value '{}' for argument [by], expected 'slug' or 'name'".format(by))
@@ -264,7 +270,8 @@ def update(self, **kwargs):
264270
265271
:return: The updated repository
266272
267-
API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#put
273+
API docs:
274+
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#put
268275
"""
269276
return self._update_data(self.put(None, data=kwargs))
270277

@@ -279,7 +286,8 @@ def delete(self, redirect_to=None):
279286
280287
:return: The response on success
281288
282-
API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#delete
289+
API docs:
290+
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D#delete
283291
"""
284292
params = {}
285293
if redirect_to is not None:

atlassian/bitbucket/cloud/workspaces/__init__.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ def each(self, role=None, q=None, sort=None):
1818
"""
1919
Get all workspaces matching the criteria.
2020
21-
:param role: string (default is None): Filters the workspaces based on the authenticated user"s role on each workspace.
22-
* member: returns a list of all the workspaces which the caller is a member of
23-
at least one workspace group or repository
24-
* collaborator: returns a list of workspaces which the caller has write access
25-
to at least one repository in the workspace
26-
* owner: returns a list of workspaces which the caller has administrator access
27-
:param q: string (default is None): Query string to narrow down the response.
28-
See https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering for details.
29-
:param sort: string (default is None): Name of a response property to sort results.
30-
See https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering for details.
21+
:param role: string (default is None):
22+
Filters the workspaces based on the authenticated user's role on each workspace.
23+
* member: returns a list of all the workspaces which the caller is a member of
24+
at least one workspace group or repository
25+
* collaborator: returns a list of workspaces which the caller has written access
26+
to at least one repository in the workspace
27+
* owner: returns a list of workspaces which the caller has administrator access
28+
:param q: string (default is None):
29+
Query string to narrow down the response.
30+
See https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering for details.
31+
:param sort: string (default is None):
32+
Name of a response property to sort results.
33+
See https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering for details.
3134
3235
:return: A generator for the Workspace objects
3336

atlassian/bitbucket/cloud/workspaces/projects.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def create(self, name, key, description, is_private=True, avatar=None):
4747
"description": description,
4848
"is_private": is_private,
4949
}
50+
if avatar:
51+
data["avatar"] = avatar
5052
return self.__get_object(self.post(None, data=data))
5153

5254
def each(self, q=None, sort=None):

atlassian/jira.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3149,7 +3149,6 @@ def get_project_issue_security_scheme(self, project_id_or_key, only_levels=False
31493149
url = "{base_url}/{project_id_or_key}/issuesecuritylevelscheme".format(
31503150
base_url=base_url, project_id_or_key=project_id_or_key
31513151
)
3152-
response = None
31533152
try:
31543153
response = self.get(url)
31553154
except HTTPError as e:

0 commit comments

Comments
 (0)