Skip to content

Commit 5f6b5a3

Browse files
committed
code cleanup
1 parent 926a9e1 commit 5f6b5a3

File tree

2 files changed

+113
-113
lines changed

2 files changed

+113
-113
lines changed

boaapi/boa_client.py

+48-48
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
BOA_PROXY = "http://boa.cs.iastate.edu/boa/?q=boa/api"
2424

2525
class NotLoggedInException(Exception):
26-
pass
26+
pass
2727

2828
class BoaException(Exception):
2929
pass
3030

3131
class BoaClient(object):
32-
""" A client class for accessing boa's api
32+
""" A client class for accessing boa's api
3333
3434
Attributes:
3535
server (xmlrpc.client.ServerProxy):
@@ -56,10 +56,10 @@ def login(self, username, password):
5656
return response
5757
except xmlrpc.client.Fault as e:
5858
raise BoaException(e).with_traceback(e.__traceback__)
59-
59+
6060
def close(self):
6161
"""Log out of the boa framework using the remote api
62-
62+
6363
Raises:
6464
BoaException: if theres an issue reading from the server
6565
"""
@@ -72,10 +72,10 @@ def close(self):
7272

7373
def ensure_logged_in(self):
7474
"""Checks if a user is currently logged in through the remote api
75-
75+
7676
Returns:
7777
bool: True if user is logged in, false if otherwise
78-
78+
7979
Raises:
8080
NotLoggedInException: if user is not currently logged in
8181
"""
@@ -99,7 +99,7 @@ def datasets(self):
9999

100100
def dataset_names(self):
101101
"""Retrieves a list of names of all datasets provided by boa
102-
102+
103103
Returns:
104104
list: the dataset names
105105
@@ -118,13 +118,13 @@ def dataset_names(self):
118118

119119
def get_dataset(self, name):
120120
"""Retrieves a dataset given a name.
121-
121+
122122
Args:
123123
name (str): The name of the input dataset to return.
124124
125125
Returns:
126126
dict: a dictionary with the keys id and name
127-
127+
128128
Raises:
129129
BoaException: if theres an issue reading from the server
130130
"""
@@ -142,7 +142,7 @@ def last_job(self):
142142
143143
Returns:
144144
JobHandle: the last submitted job
145-
145+
146146
Raises:
147147
BoaException: if theres an issue reading from the server
148148
"""
@@ -155,14 +155,14 @@ def last_job(self):
155155

156156
def job_count(self, pub_only=False):
157157
"""Retrieves the number of jobs submitted by a user
158-
158+
159159
Args:
160160
pub_only (bool, optional): if true, return only public jobs
161161
otherwise return all jobs
162-
162+
163163
Returns:
164164
int: the number of jobs submitted by a user
165-
165+
166166
Raises:
167167
BoaException: if theres an issue reading from the server
168168
"""
@@ -179,9 +179,9 @@ def query(self, query, dataset=None):
179179
query (str): a boa query represented as a string.
180180
dataset (str, optional): the name of the input dataset.
181181
182-
Returns:
183-
(JobHandle) a job
184-
182+
Returns:
183+
(JobHandle) a job
184+
185185
Raises:
186186
BoaException: if theres an issue reading from the server
187187
"""
@@ -195,13 +195,13 @@ def query(self, query, dataset=None):
195195

196196
def get_job(self, id):
197197
"""Retrieves a job given an id.
198-
198+
199199
Args:
200-
id (int): the id of the job you want to retrieve
200+
id (int): the id of the job you want to retrieve
201201
202202
Returns:
203203
JobHandle: the desired job.
204-
204+
205205
Raises:
206206
BoaException: if theres an issue reading from the server
207207
"""
@@ -213,7 +213,7 @@ def get_job(self, id):
213213

214214
def job_list(self, pub_only=False, offset=0, length=1000):
215215
"""Returns a list of the most recent jobs, based on an offset and length.
216-
216+
217217
This includes public and private jobs. Returned jobs are ordered from newest to oldest
218218
219219
Args:
@@ -223,7 +223,7 @@ def job_list(self, pub_only=False, offset=0, length=1000):
223223
224224
Returns:
225225
list: a list of jobs where each element is a jobHandle
226-
226+
227227
Raises:
228228
BoaException: if theres an issue reading from the server
229229
"""
@@ -243,7 +243,7 @@ def stop(self, job):
243243
244244
Args:
245245
job (JobHandle): the job whose execution you want to stop
246-
246+
247247
Raises:
248248
BoaException: if theres an issue reading from the server
249249
"""
@@ -256,9 +256,9 @@ def stop(self, job):
256256
def resubmit(self, job):
257257
"""Resubmits a job to the framework
258258
259-
Args:
259+
Args:
260260
job (JobHandle): The job you want to resubmit
261-
261+
262262
Raises:
263263
BoaException: if theres an issue reading from the server
264264
"""
@@ -270,10 +270,10 @@ def resubmit(self, job):
270270

271271
def delete(self, job):
272272
"""Deletes this job from the framework.
273-
274-
Args:
273+
274+
Args:
275275
job (JobHandle): the job you want to delete
276-
276+
277277
Raises:
278278
BoaException: if theres an issue reading from the server
279279
"""
@@ -285,14 +285,14 @@ def delete(self, job):
285285

286286
def set_public(self, job, is_public):
287287
"""Modifies the public/private status of this job.
288-
289-
Args:
290-
is_public (bool): 'True' to make it public, False to make it private
288+
289+
Args:
290+
is_public (bool): 'True' to make it public, False to make it private
291291
job (JobHandle)
292-
292+
293293
Raises:
294294
BoaException: if theres an issue reading from the server
295-
"""
295+
"""
296296
self.ensure_logged_in()
297297
try:
298298
if is_public is True:
@@ -304,10 +304,10 @@ def set_public(self, job, is_public):
304304

305305
def public_status(self, job):
306306
"""Get the jobs public/private status.
307-
308-
Args:
307+
308+
Args:
309309
job (JobHandle)
310-
310+
311311
Raises:
312312
BoaException: if theres an issue reading from the server
313313
"""
@@ -323,10 +323,10 @@ def public_status(self, job):
323323

324324
def get_url(self, job):
325325
"""Retrieves the jobs URL.
326-
327-
Args:
326+
327+
Args:
328328
job (JobHandle)
329-
329+
330330
Raises:
331331
BoaException: if theres an issue reading from the server
332332
"""
@@ -338,10 +338,10 @@ def get_url(self, job):
338338

339339
def public_url(self, job):
340340
"""Get the jobs public page URL.
341-
342-
Args:
341+
342+
Args:
343343
job (JobHandle)
344-
344+
345345
Raises:
346346
BoaException: if theres an issue reading from the server
347347
"""
@@ -353,10 +353,10 @@ def public_url(self, job):
353353

354354
def get_compiler_errors(self, job):
355355
"""Return any errors from trying to compile the job.
356-
357-
Args:
356+
357+
Args:
358358
job (JobHandle)
359-
359+
360360
Raises:
361361
BoaException: if theres an issue reading from the server
362362
"""
@@ -368,10 +368,10 @@ def get_compiler_errors(self, job):
368368

369369
def source(self, job):
370370
"""Return the source query for this job.
371-
372-
Args:
371+
372+
Args:
373373
job (JobHandle)
374-
374+
375375
Raises:
376376
BoaException: if theres an issue reading from the server
377377
"""
@@ -383,7 +383,7 @@ def source(self, job):
383383

384384
def output(self, job):
385385
"""Return the output for this job, if it finished successfully and has an output.
386-
386+
387387
Raises:
388388
BoaException: if theres an issue reading from the server
389389
"""

0 commit comments

Comments
 (0)