7
7
############################################################
8
8
9
9
from __future__ import print_function
10
+
10
11
# the following is a hack to get the baseclient to import whether we're in a
11
12
# package or not. This makes pep8 unhappy hence the annotations.
12
13
try :
13
14
# 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
15
18
except ImportError :
16
19
# no they aren't
17
20
from baseclient import BaseClient as _BaseClient # @Reimport
18
21
19
22
20
23
class AbstractHandle (object ):
21
-
22
24
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
+ ):
27
35
if url is None :
28
- raise ValueError (' A url is required' )
36
+ raise ValueError (" A url is required" )
29
37
self ._service_ver = None
30
38
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 ,
33
45
trust_all_ssl_certificates = trust_all_ssl_certificates ,
34
- auth_svc = auth_svc )
46
+ auth_svc = auth_svc ,
47
+ )
35
48
36
49
def persist_handle (self , handle , context = None ):
37
50
"""
@@ -52,8 +65,9 @@ def persist_handle(self, handle, context=None):
52
65
of String
53
66
:returns: instance of String
54
67
"""
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
+ )
57
71
58
72
def hids_to_handles (self , hids , context = None ):
59
73
"""
@@ -84,8 +98,9 @@ def hids_to_handles(self, hids, context=None):
84
98
String, parameter "remote_md5" of String, parameter "remote_sha1"
85
99
of String
86
100
"""
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
+ )
89
104
90
105
def ids_to_handles (self , ids , context = None ):
91
106
"""
@@ -108,8 +123,9 @@ def ids_to_handles(self, ids, context=None):
108
123
String, parameter "remote_md5" of String, parameter "remote_sha1"
109
124
of String
110
125
"""
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
+ )
113
129
114
130
def fetch_handles_by (self , params , context = None ):
115
131
"""
@@ -132,8 +148,9 @@ def fetch_handles_by(self, params, context=None):
132
148
String, parameter "remote_md5" of String, parameter "remote_sha1"
133
149
of String
134
150
"""
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
+ )
137
154
138
155
def is_owner (self , hids , context = None ):
139
156
"""
@@ -151,8 +168,9 @@ def is_owner(self, hids, context=None):
151
168
to verify uploads and downloads.)
152
169
:returns: instance of Long
153
170
"""
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
+ )
156
174
157
175
def delete_handles (self , handles , context = None ):
158
176
"""
@@ -173,8 +191,9 @@ def delete_handles(self, handles, context=None):
173
191
of String
174
192
:returns: instance of Long
175
193
"""
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
+ )
178
197
179
198
def are_readable (self , hids , context = None ):
180
199
"""
@@ -192,8 +211,9 @@ def are_readable(self, hids, context=None):
192
211
to verify uploads and downloads.)
193
212
:returns: instance of Long
194
213
"""
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
+ )
197
217
198
218
def is_readable (self , hid , context = None ):
199
219
"""
@@ -210,8 +230,9 @@ def is_readable(self, hid, context=None):
210
230
downloads.)
211
231
:returns: instance of Long
212
232
"""
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
+ )
215
236
216
237
def add_read_acl (self , hids , username , context = None ):
217
238
"""
@@ -231,8 +252,9 @@ def add_read_acl(self, hids, username, context=None):
231
252
:param username: instance of String
232
253
:returns: instance of Long
233
254
"""
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
+ )
236
258
237
259
def set_public_read (self , hids , context = None ):
238
260
"""
@@ -250,9 +272,11 @@ def set_public_read(self, hids, context=None):
250
272
to verify uploads and downloads.)
251
273
:returns: instance of Long
252
274
"""
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
+ )
255
278
256
279
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