Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • duncanmmacleod/dqsegdb-client
  • computing/dqsegdb/client
2 results
Show changes
Commits on Source (2)
#!/usr/bin/env python3
# Copyright (C) 2014-2020 Syracuse University, European Gravitational Observatory, and Christopher Newport University. Written by Ryan Fisher and Gary Hemming. See the NOTICE file distributed with this work for additional information regarding copyright ownership.
#
# This program is free software: you can redistribute it and/or modify
......@@ -77,7 +76,7 @@ __verbose_msg__ = "version: " + get_versions()['version'] + "\nfull-revisionid:
#
def parse_command_line():
def parse_command_line(args=None):
"""
Parse the command line, return an options object
"""
......@@ -106,7 +105,7 @@ def parse_command_line():
parser.add_option("-f", "--tom-formatting", action = "store_true", help = "Tom Dent requested formatting option: condensed output into single lines.")
parser.add_option("-b", "--seperate-good-from-bad", action = "store_true", help = "Seperates flags marked by the database as being active when the ifo is in a bad state from those that are active when the ifo is in a good state.")
options, time = parser.parse_args()
options, time = parser.parse_args(args=args)
# Make sure we have required arguments
if options.segment_url:
......@@ -291,8 +290,9 @@ def get_full_name(ifo, name, version):
# =============================================================================
#
if __name__ == '__main__':
options, database_location, time = parse_command_line()
def main(args=None):
options, database_location, time = parse_command_line(args=args)
o=urlparse(options.segment_url)
protocol=o.scheme
......@@ -474,4 +474,5 @@ if __name__ == '__main__':
fh.close()
if __name__ == "__main__":
sys.exit(main())
#!/usr/bin/env python3
#
# Copyright (C) 2014-2020 Syracuse University, European Gravitational Observatory, and Christopher Newport University. Written by Ryan Fisher and Gary Hemming. See the NOTICE file distributed with this work for additional information regarding copyright ownership.
#
# This program is free software: you can redistribute it and/or modify
......@@ -107,7 +105,7 @@ __formatted_date__ = __date__[0:10] + " " + __date__[11:19] + " +0000"
#
def parse_command_line():
def parse_command_line(args=None):
"""
Parse the command line, return an options object
"""
......@@ -148,7 +146,7 @@ def parse_command_line():
parser.add_option("-o", "--output-file", metavar = "output_file", help = "File to which output should be written. Defaults to stdout.")
#parser.add_option("-v", "--debug", metavar="debug", help= "Turn on debugging.")
options, others = parser.parse_args()
options, others = parser.parse_args(args=args)
# Make sure we have exactly one thing to do
count = 0
......@@ -691,7 +689,7 @@ def setup_files(dir_name, gps_start_time, gps_end_time):
# =============================================================================
#
if __name__ == '__main__':
def main(args=None):
options, database_location, file_location = parse_command_line()
# Ping the database and exit if requested
......@@ -762,3 +760,5 @@ if __name__ == '__main__':
os.remove(temp_db)
if __name__ == '__main__':
sys.exit(main())
......@@ -36,6 +36,12 @@ setup(name=PACKAGENAME,
packages=packagenames,
ext_modules=[],
scripts=scripts,
entry_points={
"console_scripts": [
"ligolw_dq_query_dqsegdb = dqsegdb.tools.ligolw_dq_query:main",
"ligolw_segment_query_dqsegdb = dqsegdb.tools.ligolw_segment_query:main",
],
},
setup_requires=['setuptools'],
install_requires=[
'gwdatafind',
......