Skip to content

Commit

Permalink
pylint: fixes invalid-name
Browse files Browse the repository at this point in the history
  • Loading branch information
aicardi-obspm committed Jan 31, 2020
1 parent e63b1eb commit 1342e27
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 150 deletions.
74 changes: 37 additions & 37 deletions uws/UWS/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ def get_job_list(self, filters=None):

try:
response = self.connection.get('', params)
except Exception as e:
except Exception as exc:
# Do not try to make a second request without parameters here,
# because cannot call self.connection.get() a second time and reusing the connection
# without calling a getresponse() or close() or something beforehand.
# (This would lead to a httplib CannotSendRequest() error!)
# Let's just raise the error immediately.
raise UWSError(str(e))
raise UWSError(str(exc))

raw = response.read()

try:
job_list = models.Jobs(raw)
except XMLSyntaxError as e:
except XMLSyntaxError as exc:
raise UWSError("Malformatted response. Are you sure the host you specified is a "
"IVOA UWS service?", raw)
except Exception as e:
raise e
except Exception as exc:
raise exc

return job_list

Expand Down Expand Up @@ -129,27 +129,27 @@ def get_job(self, jid, wait=None, phase=None):

try:
response = self.connection.get(jid, params)
except Exception as e:
except Exception as exc:
# Do not make a second request without params, throw error
# immediately
raise UWSError(str(e))
raise UWSError(str(exc))

raw = response.read()
try:
result = models.Job(raw)
except XMLSyntaxError as e:
except XMLSyntaxError as exc:
raise UWSError("Malformatted response. Are you sure the host you specified is a "
"IVOA UWS service?", raw)
except Exception as e:
raise e
except Exception as exc:
raise exc

return result

def get_phase(self, jid):
try:
response = self.connection.get(jid + '/phase')
except Exception as e:
raise UWSError(str(e))
except Exception as exc:
raise UWSError(str(exc))

raw = response.read()
result = str(raw, 'utf-8')
Expand All @@ -160,85 +160,85 @@ def new_job(self, args=None):
args = args or {}
try:
response = self.connection.post('', args)
except Exception as e:
raise UWSError(str(e))
except Exception as exc:
raise UWSError(str(exc))

raw = response.read()
try:
result = models.Job(raw)
except XMLSyntaxError as e:
except XMLSyntaxError as exc:
raise UWSError("Malformatted response. Are you sure the host you specified is a "
"IVOA UWS service?", raw)
except Exception as e:
raise e
except Exception as exc:
raise exc

return result

def set_parameters_job(self, jid, args=None):
args = args or {}
try:
response = self.connection.post(jid, args)
except Exception as e:
raise UWSError(str(e))
except Exception as exc:
raise UWSError(str(exc))

raw = response.read()
try:
result = models.Job(raw)
except XMLSyntaxError as e:
except XMLSyntaxError as exc:
raise UWSError("Malformatted response. Are you sure the host you specified is a "
"IVOA UWS service?", raw)
except Exception as e:
raise e
except Exception as exc:
raise exc

return result

def run_job(self, jid):
try:
response = self.connection.post(jid + '/phase', {"PHASE": "RUN"})
except Exception as e:
raise UWSError(str(e))
except Exception as exc:
raise UWSError(str(exc))

raw = response.read()
try:
result = models.Job(raw)
except XMLSyntaxError as e:
except XMLSyntaxError as exc:
raise UWSError("Malformatted response. Are you sure the host you specified is a "
"IVOA UWS service?", raw)
except Exception as e:
raise e
except Exception as exc:
raise exc

return result

def abort_job(self, jid):
try:
response = self.connection.post(jid, {"PHASE": "ABORT"})
except Exception as e:
raise UWSError(str(e))
except Exception as exc:
raise UWSError(str(exc))

raw = response.read()
try:
result = models.Job(raw)
except XMLSyntaxError as e:
except XMLSyntaxError as exc:
raise UWSError("Malformatted response. Are you sure the host you specified is a IVOA "
"UWS service?", raw)
except Exception as e:
raise e
except Exception as exc:
raise exc

return result

def delete_job(self, jid):
try:
response = self.connection.delete(jid)
except Exception as e:
raise UWSError(str(e))
except Exception as exc:
raise UWSError(str(exc))

raw = response.read()
try:
result = True
except XMLSyntaxError as e:
except XMLSyntaxError as exc:
raise UWSError("Malformatted response. Are you sure the host you specified is a IVOA "
"UWS service?", raw)
except Exception as e:
raise e
except Exception as exc:
raise exc

return result
Loading

0 comments on commit 1342e27

Please sign in to comment.