8000 refactor(asyncio): run black · python-gitlab/python-gitlab@e3d52df · GitHub
[go: up one dir, main page]

Skip to content

Commit e3d52df

Browse files
committed
refactor(asyncio): run black
1 parent 28bd245 commit e3d52df

File tree

3 files changed

+168
-72
lines changed

3 files changed

+168
-72
lines changed

gitlab/__init__.py

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@
2727

2828
import gitlab.config
2929
from gitlab.const import * # noqa
30-
from gitlab.exceptions import (on_http_error, GitlabVerifyError,
31-
GitlabMarkdownError, GitlabLicenseError, RedirectError,
32-
GitlabHttpError, GitlabAuthenticationError,
33-
GitlabParsingError, GitlabSearchError)
30+
from gitlab.exceptions import (
31+
on_http_error,
32+
GitlabVerifyError,
33+
GitlabMarkdownError,
34+
GitlabLicenseError,
35+
RedirectError,
36+
GitlabHttpError,
37+
GitlabAuthenticationError,
38+
GitlabParsingError,
39+
GitlabSearchError,
40+
)
3441
from gitlab import utils # noqa
3542

3643
__title__ = "python-gitlab"
@@ -572,7 +579,9 @@ async def http_request(
572579
response_body=result.content,
573580
)
574581

575-
async def http_get(self, path, query_data=None, streamed=False, raw=False, **kwargs):
582+
async def http_get(
583+
self, path, query_data=None, streamed=False, raw=False, **kwargs
584+
):
576585
"""Make a GET request to the Gitlab server.
577586
578587
Args:
@@ -650,8 +659,9 @@ async def http_list(self, path, query_data=None, as_list=None, **kwargs):
650659
# No pagination, generator requested
651660
return GitlabList(self, url, query_data, **kwargs)
652661

653-
async def http_post(self, path, query_data=None,
654-
post_data=None, files=None, **kwargs):
662+
async def http_post(
663+
self, path, query_data=None, post_data=None, files=None, **kwargs
664+
):
655665
"""Make a POST request to the Gitlab server.
656666
657667
Args:
@@ -689,8 +699,9 @@ async def http_post(self, path, query_data=None,
689699
raise GitlabParsingError(error_message="Failed to parse the server message")
690700
return result
691701

692-
async def http_put(self, path, query_data=None,
693-
post_data=None, files=None, **kwargs):
702+
async def http_put(
703+
self, path, query_data=None, post_data=None, files=None, **kwargs
704+
):
694705
"""Make a PUT request to the Gitlab server.
695706
696707
Args:
@@ -775,10 +786,9 @@ async def __init__(self, gl, url, query_data, get_next=True, **kwargs):
775786

776787
async def _query(self, url, query_data=None, **kwargs):
777788
query_data = query_data or {}
778-
result = await self._gl.http_request("get",
779-
url,
780-
query_data=query_data,
781-
**kwargs)
789+
result = await self._gl.http_request(
790+
"get", url, query_data=query_data, **kwargs
791+
)
782792
try:
783793
self._next_url = result.links["next"]["url"]
784794
except KeyError:

gitlab/mixins.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def get(self, id=None, **kwargs):
8080
loop = asyncio.get_event_loop()
8181
return loop.run_until_complete(self.async_get(id, **kwargs))
8282

83+
8384
class RefreshMixin(object):
8485
@exc.on_http_error(exc.GitlabGetError)
8586
async def async_refresh(self, **kwargs):
@@ -217,8 +218,9 @@ async def async_create(self, data, **kwargs):
217218

218219
# Handle specific URL for creation
219220
path = kwargs.pop("path", self.path)
220-
server_data = await self.gitlab.http_post(path, post_data=data,
221-
files=files, **kwargs)
221+
server_data = await self.gitlab.http_post(
222+
path, post_data=data, files=files, **kwargs
223+
)
222224
return self._obj_cls(self, server_data)
223225

224226
def create(self, data, **kwargs):

0 commit comments

Comments
 (0)
0