ligo.gracedb: removed all trailing whitespace

because I'm pedantic
parent b963f2f1
......@@ -29,7 +29,7 @@ DEFAULT_BASIC_URL = "https://gracedb.ligo.org/apibasic/"
GIT_TAG = 'gracedb-1.25-1'
DEFAULT_COLUMNS = "graceid,labels,group,pipeline,search,far,gpstime,created,dataurl"
#-----------------------------------------------------------------
# Util routines
......@@ -78,8 +78,8 @@ typeCodeMap = {
validTypes = list(typeCodeMap.keys())
#-----------------------------------------------------------------
# This is a factory for client classes.
# Given a base client class with the correct properties, derive
# This is a factory for client classes.
# Given a base client class with the correct properties, derive
# one suitable for use with this command-line tool. In practice,
# the base class here will either be the X509 auth GraceDb class
# or the basic auth GraceDbBasic class.
......@@ -129,7 +129,7 @@ def derive_client(ClientBase=GraceDb):
Client = derive_client()
#-----------------------------------------------------------------
# Main
# Main
def main():
......@@ -152,11 +152,11 @@ def main():
%%prog [options] ping
Test server connection
%%prog [options] upload GRACEID FILE [COMMENT]
%%prog [options] upload GRACEID FILE [COMMENT]
where GRACEID is the id of an existing candidate event in GraCEDb
FILE is the name of the file to upload. '-' indicates stdin.
COMMENT is an optional annotation to enter into the log
Upload FILE to the private data area for a candidate event. To apply
Upload FILE to the private data area for a candidate event. To apply
a tag, use the --tag-name option (and --tag-display-name if desired.)
%%prog [options] download GRACEID FILE [DESTINATION]
......@@ -180,12 +180,12 @@ def main():
LOG_N is the number of the log message.
TAG_NAME is the name of the tag
DISP_NAME is the tag display name (ignored for existing tags)
Tag an existing log message. Alternatively, the tag name and
display name can be passed in with the --tag-name and
Tag an existing log message. Alternatively, the tag name and
display name can be passed in with the --tag-name and
--tag-display-name options.
%%prog [options] delete_tag GRACEID LOG_N TAG_NAME
Remove a tag from a log message. Alternatively, the tag name
Remove a tag from a log message. Alternatively, the tag name
can be passed in with the --tag-name option.
%%prog [options] search SEARCH PARAMS
......@@ -286,7 +286,7 @@ Longer strings will be truncated.""" % {
# If the user requested a specific service, but also wants basic auth,
# then the service had better be a basic auth endpoint. Otherwise die.
# On the other hand, if the user did not specify a service url, then we
# On the other hand, if the user did not specify a service url, then we
# will use the default basic URL if basic auth was requested.
if options.use_basic_auth:
if options.service or os.environ.get('GRACEDB_SERVICE_URL', None):
......@@ -296,7 +296,7 @@ Longer strings will be truncated.""" % {
else:
service = DEFAULT_BASIC_URL
# Client subclass according to preferred auth method.
# Client subclass according to preferred auth method.
global Client
if options.use_basic_auth:
Client = derive_client(GraceDbBasic)
......@@ -424,7 +424,7 @@ Longer strings will be truncated.""" % {
response = client.writeLabel(graceid, label)
elif args[0] == 'search':
query = " ".join(args[1:])
columns = options.columns
columns = columns.replace('DEFAULTS',DEFAULT_COLUMNS)
columns = columns.split(',')
......@@ -461,7 +461,7 @@ Longer strings will be truncated.""" % {
row = [ accessFun.get(column, lambda e: defaultAccess(e,column))(e) for column in columns ]
row = "\t".join(row)
output(row)
return 0
elif args[0] == 'replace':
if len(args) != 3:
......
......@@ -26,13 +26,13 @@ Usage:
import logging
import ligo.gracedb.rest
import ligo.gracedb.logging
logging.basicConfig()
log = logging.getLogger('testing')
gracedb = ligo.gracedb.rest.GraceDb()
graceid = 'T62829'
log.addHandler(ligo.gracedb.logging.GraceDbLogHandler(gracedb, graceid))
# The following will create a log entry on the gracedb server
......
This diff is collapsed.
......@@ -31,7 +31,7 @@ from six.moves import range
# To run:
#
# python $PATH_TO_GRACEDB_LIB/test/test.py
#
#
# Environment Variables:
#
# TEST_SERVICE
......@@ -94,7 +94,7 @@ class TestGraceDb(unittest.TestCase):
# Create event and get its graceid
eventFile = os.path.join(testdatadir, "cbc-lm.xml")
createdEvent = gracedb.createEvent("Test", "gstlal", eventFile,
createdEvent = gracedb.createEvent("Test", "gstlal", eventFile,
"LowMass", offline=offline).json()
eventId = createdEvent["graceid"]
......@@ -356,7 +356,7 @@ class TestGraceDb(unittest.TestCase):
import logging
import ligo.gracedb.rest
import ligo.gracedb.logging
logging.basicConfig()
log = logging.getLogger('testing')
log.propagate = False # Don't write to console
......
......@@ -75,7 +75,7 @@ class TestGraceDbVOEvents(unittest.TestCase):
def test_retrieve_preliminary_voevent(self):
r = gracedb.voevents(graceid)
voevent_list = r.json()['voevents']
self.assertTrue(len(voevent_list) == 1 and
self.assertTrue(len(voevent_list) == 1 and
voevent_list[0]['voevent_type'] == 'PR')
def test_create_update_voevent(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment