servicemon/query_runner.py
def _parse_query(input_args):
    """
    # Parse args and apply defaults.
    """
    parser = _create_query_argparser()

    # Parse the arguments.  If args is None, then the args implicitly come from sys.argv.
    args = parser.parse_args(input_args)

    # Catch SIGHUP, SIGQUIT and SIGTERM to allow running in the background.
    catch_signals()

    # Validate args.
    if ((args.min_radius is not None or
         args.max_radius is not None) and
            args.num_cones is None):
        parser.error(message='argument --num-cones is required when '
                     '--min-radius or --max-radius are present.')

    if args.num_cones is None and args.cone_file is None:
        parser.error(message='Either --num-cones or --cone_file must be present\n'
                     '   to specify what values go into the service file templates.')

    # Apply defaults that couldn't be built in.
    apply_query_defaults(args, conegen_defaults)
    apply_query_defaults(args, conelist_defaults)
    if args.writers is None:
        # Default to the csv_writer and its default output file.
        args.writers = ['csv_writer']

    return args

    # Parse args and apply defaults.
    
Parse args and apply defaults.
Parse args and apply defaults .
def _parse_query(input_args):
    parser = _create_query_argparser()
    args = parser.parse_args(input_args)
    catch_signals()
    if ((args.min_radius is not None or
         args.max_radius is not None) and
            args.num_cones is None):
        parser.error(message='argument --num-cones is required when '
                     '--min-radius or --max-radius are present.')
    if args.num_cones is None and args.cone_file is None:
        parser.error(message='Either --num-cones or --cone_file must be present\n'
                     '   to specify what values go into the service file templates.')
    apply_query_defaults(args, conegen_defaults)
    apply_query_defaults(args, conelist_defaults)
    if args.writers is None:
        args.writers = ['csv_writer']
    return args
def _parse_query ( input_args ) : parser = _create_query_argparser ( ) args = parser . parse_args ( input_args ) catch_signals ( ) if ( ( args . min_radius is not None or args . max_radius is not None ) and args . num_cones is None ) : parser . error ( message = 'argument --num-cones is required when ' '--min-radius or --max-radius are present.' ) if args . num_cones is None and args . cone_file is None : parser . error ( message = 'Either --num-cones or --cone_file must be present\n' '   to specify what values go into the service file templates.' ) apply_query_defaults ( args , conegen_defaults ) apply_query_defaults ( args , conelist_defaults ) if args . writers is None : args . writers = [ 'csv_writer' ] return args
Parse args and apply defaults.
Parse args and apply defaults .
"""
    # Parse args and apply defaults.
    """ # Parse the arguments.  If args is None, then the args implicitly come from sys.argv. # Catch SIGHUP, SIGQUIT and SIGTERM to allow running in the background. # Validate args. # Apply defaults that couldn't be built in. # Default to the csv_writer and its default output file.
input_args