Skip to content

Commit b8cc716

Browse files
committed
black + fbamodel IO
1 parent 2d30b51 commit b8cc716

File tree

72 files changed

+21484
-4318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+21484
-4318
lines changed

cobrakbase/AbstractHandleClient.py

+56-32
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,44 @@
77
############################################################
88

99
from __future__ import print_function
10+
1011
# the following is a hack to get the baseclient to import whether we're in a
1112
# package or not. This makes pep8 unhappy hence the annotations.
1213
try:
1314
# baseclient and this client are in a package
14-
from cobrakbase.Workspace.baseclient import BaseClient as _BaseClient # @UnusedImport
15+
from cobrakbase.Workspace.baseclient import (
16+
BaseClient as _BaseClient,
17+
) # @UnusedImport
1518
except ImportError:
1619
# no they aren't
1720
from baseclient import BaseClient as _BaseClient # @Reimport
1821

1922

2023
class AbstractHandle(object):
21-
2224
def __init__(
23-
self, url=None, timeout=30 * 60, user_id=None,
24-
password=None, token=None, ignore_authrc=False,
25-
trust_all_ssl_certificates=False,
26-
auth_svc='https://ci.kbase.us/services/auth/api/legacy/KBase/Sessions/Login'):
25+
self,
26+
url=None,
27+
timeout=30 * 60,
28+
user_id=None,
29+
password=None,
30+
token=None,
31+
ignore_authrc=False,
32+
trust_all_ssl_certificates=False,
33+
auth_svc="https://ci.kbase.us/services/auth/api/legacy/KBase/Sessions/Login",
34+
):
2735
if url is None:
28-
raise ValueError('A url is required')
36+
raise ValueError("A url is required")
2937
self._service_ver = None
3038
self._client = _BaseClient(
31-
url, timeout=timeout, user_id=user_id, password=password,
32-
token=token, ignore_authrc=ignore_authrc,
39+
url,
40+
timeout=timeout,
41+
user_id=user_id,
42+
password=password,
43+
token=token,
44+
ignore_authrc=ignore_authrc,
3345
trust_all_ssl_certificates=trust_all_ssl_certificates,
34-
auth_svc=auth_svc)
46+
auth_svc=auth_svc,
47+
)
3548

3649
def persist_handle(self, handle, context=None):
3750
"""
@@ -52,8 +65,9 @@ def persist_handle(self, handle, context=None):
5265
of String
5366
:returns: instance of String
5467
"""
55-
return self._client.call_method('AbstractHandle.persist_handle',
56-
[handle], self._service_ver, context)
68+
return self._client.call_method(
69+
"AbstractHandle.persist_handle", [handle], self._service_ver, context
70+
)
5771

5872
def hids_to_handles(self, hids, context=None):
5973
"""
@@ -84,8 +98,9 @@ def hids_to_handles(self, hids, context=None):
8498
String, parameter "remote_md5" of String, parameter "remote_sha1"
8599
of String
86100
"""
87-
return self._client.call_method('AbstractHandle.hids_to_handles',
88-
[hids], self._service_ver, context)
101+
return self._client.call_method(
102+
"AbstractHandle.hids_to_handles", [hids], self._service_ver, context
103+
)
89104

90105
def ids_to_handles(self, ids, context=None):
91106
"""
@@ -108,8 +123,9 @@ def ids_to_handles(self, ids, context=None):
108123
String, parameter "remote_md5" of String, parameter "remote_sha1"
109124
of String
110125
"""
111-
return self._client.call_method('AbstractHandle.ids_to_handles',
112-
[ids], self._service_ver, context)
126+
return self._client.call_method(
127+
"AbstractHandle.ids_to_handles", [ids], self._service_ver, context
128+
)
113129

114130
def fetch_handles_by(self, params, context=None):
115131
"""
@@ -132,8 +148,9 @@ def fetch_handles_by(self, params, context=None):
132148
String, parameter "remote_md5" of String, parameter "remote_sha1"
133149
of String
134150
"""
135-
return self._client.call_method('AbstractHandle.fetch_handles_by',
136-
[params], self._service_ver, context)
151+
return self._client.call_method(
152+
"AbstractHandle.fetch_handles_by", [params], self._service_ver, context
153+
)
137154

138155
def is_owner(self, hids, context=None):
139156
"""
@@ -151,8 +168,9 @@ def is_owner(self, hids, context=None):
151168
to verify uploads and downloads.)
152169
:returns: instance of Long
153170
"""
154-
return self._client.call_method('AbstractHandle.is_owner',
155-
[hids], self._service_ver, context)
171+
return self._client.call_method(
172+
"AbstractHandle.is_owner", [hids], self._service_ver, context
173+
)
156174

157175
def delete_handles(self, handles, context=None):
158176
"""
@@ -173,8 +191,9 @@ def delete_handles(self, handles, context=None):
173191
of String
174192
:returns: instance of Long
175193
"""
176-
return self._client.call_method('AbstractHandle.delete_handles',
177-
[handles], self._service_ver, context)
194+
return self._client.call_method(
195+
"AbstractHandle.delete_handles", [handles], self._service_ver, context
196+
)
178197

179198
def are_readable(self, hids, context=None):
180199
"""
@@ -192,8 +211,9 @@ def are_readable(self, hids, context=None):
192211
to verify uploads and downloads.)
193212
:returns: instance of Long
194213
"""
195-
return self._client.call_method('AbstractHandle.are_readable',
196-
[hids], self._service_ver, context)
214+
return self._client.call_method(
215+
"AbstractHandle.are_readable", [hids], self._service_ver, context
216+
)
197217

198218
def is_readable(self, hid, context=None):
199219
"""
@@ -210,8 +230,9 @@ def is_readable(self, hid, context=None):
210230
downloads.)
211231
:returns: instance of Long
212232
"""
213-
return self._client.call_method('AbstractHandle.is_readable',
214-
[hid], self._service_ver, context)
233+
return self._client.call_method(
234+
"AbstractHandle.is_readable", [hid], self._service_ver, context
235+
)
215236

216237
def add_read_acl(self, hids, username, context=None):
217238
"""
@@ -231,8 +252,9 @@ def add_read_acl(self, hids, username, context=None):
231252
:param username: instance of String
232253
:returns: instance of Long
233254
"""
234-
return self._client.call_method('AbstractHandle.add_read_acl',
235-
[hids, username], self._service_ver, context)
255+
return self._client.call_method(
256+
"AbstractHandle.add_read_acl", [hids, username], self._service_ver, context
257+
)
236258

237259
def set_public_read(self, hids, context=None):
238260
"""
@@ -250,9 +272,11 @@ def set_public_read(self, hids, context=None):
250272
to verify uploads and downloads.)
251273
:returns: instance of Long
252274
"""
253-
return self._client.call_method('AbstractHandle.set_public_read',
254-
[hids], self._service_ver, context)
275+
return self._client.call_method(
276+
"AbstractHandle.set_public_read", [hids], self._service_ver, context
277+
)
255278

256279
def status(self, context=None):
257-
return self._client.call_method('AbstractHandle.status',
258-
[], self._service_ver, context)
280+
return self._client.call_method(
281+
"AbstractHandle.status", [], self._service_ver, context
282+
)

0 commit comments

Comments
 (0)