19
19
# Astropy imports
20
20
from astropy .table import Table
21
21
import astropy .io .votable as votable
22
- from astroquery import log as logging
22
+ from astroquery import log
23
23
24
24
# Astroquery imports
25
25
from ..query import QueryWithLogin
@@ -72,8 +72,8 @@ def _login(self, username=None, password=None, store_password=False,
72
72
73
73
# login after login (interactive)
74
74
if hasattr (self , 'username' ):
75
- logging .warning ("Attempting to login while another user ({0}) "
76
- "is already logged in." .format (self .username ))
75
+ log .warning ("Attempting to login while another user ({0}) "
76
+ "is already logged in." .format (self .username ))
77
77
self .check_login_status ()
78
78
return
79
79
@@ -144,7 +144,7 @@ def logout(self, deletepw=False):
144
144
del self .username
145
145
del self .password
146
146
else :
147
- logging .error ("You must log in before attempting to logout." )
147
+ log .error ("You must log in before attempting to logout." )
148
148
149
149
def check_login_status (self ):
150
150
"""
@@ -220,8 +220,8 @@ def run_sql_query(self, query_string, tablename=None, queue=None,
220
220
gen_tablename = "{0}" .format (phase )
221
221
else :
222
222
gen_tablename = str (soup .find (id = "table" ).string )
223
- logging .warning ("Table name {0} is already taken."
224
- .format (tablename ))
223
+ log .warning ("Table name {0} is already taken."
224
+ .format (tablename ))
225
225
warnings .warn ("Generated table name: {0}" .format (gen_tablename ))
226
226
elif tablename is None :
227
227
result = self ._request ('POST' , CosmoSim .QUERY_URL ,
@@ -293,7 +293,7 @@ def check_job_status(self, jobid=None):
293
293
auth = (self .username , self .password ), data = {'print' : 'b' },
294
294
cache = False )
295
295
296
- logging .info ("Job {}: {}" .format (jobid , response .content ))
296
+ log .info ("Job {}: {}" .format (jobid , response .content ))
297
297
return response .content
298
298
299
299
def check_all_jobs (self , phase = None , regex = None , sortby = None ):
@@ -586,7 +586,7 @@ def completed_job_info(self, jobid=None, output=False):
586
586
elif len (dictkeys ) == 1 :
587
587
print (self .response_dict_current [dictkeys [0 ]]['content' ])
588
588
else :
589
- logging .error ('No completed jobs found.' )
589
+ log .error ('No completed jobs found.' )
590
590
return
591
591
else :
592
592
return
@@ -680,7 +680,7 @@ def general_job_info(self, jobid=None, output=False):
680
680
auth = (self .username , self .password ), cache = False )]
681
681
682
682
if response_list [0 ].ok is False :
683
- logging .error ('Must provide a valid jobid.' )
683
+ log .error ('Must provide a valid jobid.' )
684
684
return
685
685
else :
686
686
self .response_dict_current = {}
@@ -940,7 +940,7 @@ def explore_db(self, db=None, table=None, col=None):
940
940
for key in self .db_dict [db ].keys ()]
941
941
size2 = len (max (slist , key = np .size ))
942
942
except (KeyError , NameError ):
943
- logging .error ("Must first specify a valid database." )
943
+ log .error ("Must first specify a valid database." )
944
944
return
945
945
# if col is specified, table must be specified, and I need to
946
946
# check the max size of any given column in the structure
@@ -954,13 +954,13 @@ def explore_db(self, db=None, table=None, col=None):
954
954
[table ]['columns' ]
955
955
[col ].keys ())))
956
956
except (KeyError , NameError ):
957
- logging .error ("Must first specify a valid column "
958
- "of the `{0}` table within the `{1}`"
959
- " db" .format (table , db ))
957
+ log .error ("Must first specify a valid column "
958
+ "of the `{0}` table within the `{1}`"
959
+ " db" .format (table , db ))
960
960
return
961
961
except (KeyError , NameError ):
962
- logging .error ("Must first specify a valid table within "
963
- "the `{0}` db." .format (db ))
962
+ log .error ("Must first specify a valid table within "
963
+ "the `{0}` db." .format (db ))
964
964
return
965
965
966
966
t ['Projects' ] = (['--> @ {}:' .format (db )] +
@@ -1202,7 +1202,7 @@ def _check_phase(self, jobid):
1202
1202
time .sleep (1 )
1203
1203
1204
1204
if jobid not in self .job_dict .keys ():
1205
- logging .error ("Job not present in job dictionary." )
1205
+ log .error ("Job not present in job dictionary." )
1206
1206
return
1207
1207
1208
1208
else :
@@ -1291,7 +1291,7 @@ def _initialize_alerting(self, jobid, mail=None, text=None):
1291
1291
self ._smspw = password_from_keyring
1292
1292
1293
1293
if not password_from_keyring :
1294
- logging .warning ("CosmoSim SMS alerting has not been initialized." )
1294
+ log .warning ("CosmoSim SMS alerting has not been initialized." )
1295
1295
warnings .warn ("Initializing SMS alerting." )
1296
1296
keyring .set_password ("astroquery:cosmosim.SMSAlert" ,
1297
1297
self ._smsaddress , "LambdaCDM" )
0 commit comments