tap: Print only if verbose is True when launching job
When sending some rather large queries to a TAP server, it is annoying
that the console is spammed. Only print anything if verbose=True.
@@ -189,6 +189,7 @@ class Tap(object):
A Job object
"""
query = taputils.set_top_in_query(query, 2000)
+ if verbose:
print("Launched query: '"+str(query)+"'")
if upload_resource is not None:
if upload_table_name is None:
@@ -224,12 +225,14 @@ class Tap(object):
self.__connHandler.dump_to_file(suitableOutputFile, response)
raise Exception(response.reason)
else:
+ if verbose:
print("Retrieving sync. results...")
if dump_to_file:
self.__connHandler.dump_to_file(suitableOutputFile, response)
else:
results = utils.read_http_response(response, output_format)
job.set_results(results)
+ if verbose:
print("Query finished.")
job.set_phase('COMPLETED')
return job
@@ -265,6 +268,7 @@ class Tap(object):
-------
A Job object
"""
+ if verbose:
print("Launched query: '"+str(query)+"'")
if upload_resource is not None:
if upload_table_name is None:
@@ -310,6 +314,7 @@ class Tap(object):
job.set_jobid(jobid)
job.set_remote_location(location)
if not background:
+ if verbose:
print("Retrieving async. results...")
# saveResults or getResults will block (not background)
if dump_to_file:
