コード例 #1
0
 def add_default_options(self, optprs):
     """
     Adds the default reference viewer startup options to an
     OptionParser instance `optprs`.
     """
     optprs.add_option("--bufsize", dest="bufsize", metavar="NUM",
                       type="int", default=10,
                       help="Buffer length to NUM")
     optprs.add_option('-c', "--channels", dest="channels",
                       help="Specify list of channels to create")
     optprs.add_option("--debug", dest="debug", default=False,
                       action="store_true",
                       help="Enter the pdb debugger on main()")
     optprs.add_option("--disable-plugins", dest="disable_plugins",
                       metavar="NAMES",
                       help="Specify plugins that should be disabled")
     optprs.add_option("--display", dest="display", metavar="HOST:N",
                       help="Use X display on HOST:N")
     optprs.add_option("--fitspkg", dest="fitspkg", metavar="NAME",
                       default=None,
                       help="Prefer FITS I/O module NAME")
     optprs.add_option("-g", "--geometry", dest="geometry",
                       default=None, metavar="GEOM",
                       help="X geometry for initial size and placement")
     optprs.add_option("--modules", dest="modules", metavar="NAMES",
                       help="Specify additional modules to load")
     optprs.add_option("--norestore", dest="norestore", default=False,
                       action="store_true",
                       help="Don't restore the GUI from a saved layout")
     optprs.add_option("--nosplash", dest="nosplash", default=False,
                       action="store_true",
                       help="Don't display the splash screen")
     optprs.add_option("--numthreads", dest="numthreads", type="int",
                       default=30, metavar="NUM",
                       help="Start NUM threads in thread pool")
     optprs.add_option("--opencv", dest="opencv", default=False,
                       action="store_true",
                       help="Use OpenCv acceleration")
     optprs.add_option("--opencl", dest="opencl", default=False,
                       action="store_true",
                       help="Use OpenCL acceleration")
     optprs.add_option("--plugins", dest="plugins", metavar="NAMES",
                       help="Specify additional plugins to load")
     optprs.add_option("--profile", dest="profile", action="store_true",
                       default=False,
                       help="Run the profiler on main()")
     optprs.add_option("--sep", dest="separate_channels", default=False,
                       action="store_true",
                       help="Load files in separate channels")
     optprs.add_option("-t", "--toolkit", dest="toolkit", metavar="NAME",
                       default=None,
                       help="Prefer GUI toolkit (gtk|qt)")
     optprs.add_option("--wcspkg", dest="wcspkg", metavar="NAME",
                       default=None,
                       help="Prefer WCS module NAME")
     log.addlogopts(optprs)
コード例 #2
0
 def add_default_options(self, optprs):
     """
     Adds the default reference viewer startup options to an
     OptionParser instance `optprs`.
     """
     optprs.add_option("--bufsize", dest="bufsize", metavar="NUM",
                       type="int", default=10,
                       help="Buffer length to NUM")
     optprs.add_option('-c', "--channels", dest="channels", default="Image",
                       help="Specify list of channels to create")
     optprs.add_option("--debug", dest="debug", default=False,
                       action="store_true",
                       help="Enter the pdb debugger on main()")
     optprs.add_option("--disable-plugins", dest="disable_plugins",
                       metavar="NAMES",
                       help="Specify plugins that should be disabled")
     optprs.add_option("--display", dest="display", metavar="HOST:N",
                       help="Use X display on HOST:N")
     optprs.add_option("--fitspkg", dest="fitspkg", metavar="NAME",
                       default=None,
                       help="Prefer FITS I/O module NAME")
     optprs.add_option("-g", "--geometry", dest="geometry",
                       default=None, metavar="GEOM",
                       help="X geometry for initial size and placement")
     optprs.add_option("--modules", dest="modules", metavar="NAMES",
                       help="Specify additional modules to load")
     optprs.add_option("--nosplash", dest="nosplash", default=False,
                       action="store_true",
                       help="Don't display the splash screen")
     optprs.add_option("--numthreads", dest="numthreads", type="int",
                       default=30, metavar="NUM",
                       help="Start NUM threads in thread pool")
     optprs.add_option("--opencv", dest="opencv", default=False,
                       action="store_true",
                       help="Use OpenCv acceleration")
     optprs.add_option("--opencl", dest="opencl", default=False,
                       action="store_true",
                       help="Use OpenCL acceleration")
     optprs.add_option("--plugins", dest="plugins", metavar="NAMES",
                       help="Specify additional plugins to load")
     optprs.add_option("--profile", dest="profile", action="store_true",
                       default=False,
                       help="Run the profiler on main()")
     optprs.add_option("--sep", dest="separate_channels", default=False,
                       action="store_true",
                       help="Load files in separate channels")
     optprs.add_option("-t", "--toolkit", dest="toolkit", metavar="NAME",
                       default=None,
                       help="Prefer GUI toolkit (gtk|qt)")
     optprs.add_option("--wcspkg", dest="wcspkg", metavar="NAME",
                       default=None,
                       help="Prefer WCS module NAME")
     log.addlogopts(optprs)
コード例 #3
0
ファイル: main.py プロジェクト: jkunimune15/qplan
 def add_default_options(self, optprs):
     """
     Adds the default reference viewer startup options to an
     OptionParser instance `optprs`.
     """
     optprs.add_option("-c", "--completed", dest="completed", default=None,
                       metavar="FILE",
                       help="Specify FILE of completed OB keys")
     optprs.add_option("--date-start", dest="date_start", default=None,
                       help="Define the start of the schedule ('YYYY-MM-DD HH:MM')")
     optprs.add_option("--date-stop", dest="date_stop", default=None,
                       help="Define the end of the schedule ('YYYY-MM-DD HH:MM')")
     optprs.add_option("--debug", dest="debug", default=False, action="store_true",
                       help="Enter the pdb debugger on main()")
     optprs.add_option("--display", dest="display", metavar="HOST:N",
                       help="Use X display on HOST:N")
     optprs.add_option("-g", "--geometry", dest="geometry",
                       metavar="GEOM", default=None,
                       help="X geometry for initial size and placement")
     optprs.add_option("-i", "--input", dest="input_dir", default=".",
                       metavar="DIRECTORY",
                       help="Read input files from DIRECTORY")
     optprs.add_option("-f", "--format", dest="input_fmt", default=None,
                       metavar="FILE_FORMAT",
                       help="Specify input file format (csv, xls, or xlsx)")
     ## optprs.add_option("--modules", dest="modules", metavar="NAMES",
     ##                   help="Specify additional modules to load")
     ## optprs.add_option("--monitor", dest="monitor", metavar="NAME",
     ##                   default='monitor',
     ##                   help="Synchronize from monitor named NAME")
     ## optprs.add_option("--monchannels", dest="monchannels",
     ##                   default='status', metavar="NAMES",
     ##                   help="Specify monitor channels to subscribe to")
     ## optprs.add_option("--monport", dest="monport", type="int",
     ##                   help="Register monitor using PORT", metavar="PORT")
     optprs.add_option("--numthreads", dest="numthreads", type="int",
                       default=30,
                       help="Start NUM threads in thread pool", metavar="NUM")
     optprs.add_option("-o", "--output", dest="output_dir", default="output",
                       metavar="DIRECTORY",
                       help="Write output files to DIRECTORY")
     ## optprs.add_option("--plugins", dest="plugins", metavar="NAMES",
     ##                   help="Specify additional plugins to load")
     ## optprs.add_option("--port", dest="port", type="int", default=None,
     ##                   help="Register using PORT", metavar="PORT")
     optprs.add_option("--profile", dest="profile", action="store_true",
                       default=False,
                       help="Run the profiler on main()")
     optprs.add_option("-t", "--toolkit", dest="toolkit", metavar="NAME",
                       default='qt4',
                       help="Prefer GUI toolkit (gtk|qt)")
     log.addlogopts(optprs)
コード例 #4
0
ファイル: main.py プロジェクト: naojsoft/qplan
 def add_default_options(self, optprs):
     """
     Adds the default reference viewer startup options to an
     OptionParser instance `optprs`.
     """
     optprs.add_option("-c", "--completed", dest="completed", default=None,
                       metavar="FILE",
                       help="Specify FILE of completed OB keys")
     optprs.add_option("--date-start", dest="date_start", default=None,
                       help="Define the start of the schedule ('YYYY-MM-DD HH:MM')")
     optprs.add_option("--date-stop", dest="date_stop", default=None,
                       help="Define the end of the schedule ('YYYY-MM-DD HH:MM')")
     optprs.add_option("--debug", dest="debug", default=False, action="store_true",
                       help="Enter the pdb debugger on main()")
     optprs.add_option("--display", dest="display", metavar="HOST:N",
                       help="Use X display on HOST:N")
     optprs.add_option("-g", "--geometry", dest="geometry",
                       metavar="GEOM", default=None,
                       help="X geometry for initial size and placement")
     optprs.add_option("-i", "--input", dest="input_dir", default=".",
                       metavar="DIRECTORY",
                       help="Read input files from DIRECTORY")
     optprs.add_option("-f", "--format", dest="input_fmt", default=None,
                       metavar="FILE_FORMAT",
                       help="Specify input file format (csv, xls, or xlsx)")
     optprs.add_option("--norestore", dest="norestore", default=False,
                       action="store_true",
                       help="Don't restore the GUI from a saved layout")
     ## optprs.add_option("--modules", dest="modules", metavar="NAMES",
     ##                   help="Specify additional modules to load")
     optprs.add_option("--numthreads", dest="numthreads", type="int",
                       default=30,
                       help="Start NUM threads in thread pool", metavar="NUM")
     optprs.add_option("-o", "--output", dest="output_dir", default=None,
                       metavar="DIRECTORY",
                       help="Write output files to DIRECTORY")
     optprs.add_option("--profile", dest="profile", action="store_true",
                       default=False,
                       help="Run the profiler on main()")
     optprs.add_option("-s", "--site", dest="sitename", metavar="NAME",
                       default='subaru',
                       help="Observing site NAME")
     optprs.add_option("-t", "--toolkit", dest="toolkit", metavar="NAME",
                       default=None,
                       help="Prefer GUI toolkit (default: choose one)")
     log.addlogopts(optprs)
コード例 #5
0
                      dest="debug",
                      default=False,
                      action="store_true",
                      help="Enter the pdb debugger on main()")
    optprs.add_option("-t",
                      "--toolkit",
                      dest="toolkit",
                      metavar="NAME",
                      default='qt',
                      help="Choose GUI toolkit (gtk|qt)")
    optprs.add_option("--profile",
                      dest="profile",
                      action="store_true",
                      default=False,
                      help="Run the profiler on main()")
    log.addlogopts(optprs)

    (options, args) = optprs.parse_args(sys.argv[1:])

    # Are we debugging this?
    if options.debug:
        import pdb

        pdb.run('main(options, args)')

    # Are we profiling this?
    elif options.profile:
        import profile

        print(("%s profile:" % sys.argv[0]))
        profile.run('main(options, args)')
コード例 #6
0
    usage = "usage: %prog [options] cmd [args]"
    optprs = OptionParser(usage=usage, version=('%%prog'))

    optprs.add_option("--debug", dest="debug", default=False,
                      action="store_true",
                      help="Enter the pdb debugger on main()")
    optprs.add_option("--opencv", dest="opencv", default=False,
                      action="store_true",
                      help="Use OpenCv acceleration")
    optprs.add_option("--opencl", dest="opencl", default=False,
                      action="store_true",
                      help="Use OpenCL acceleration")
    optprs.add_option("--profile", dest="profile", action="store_true",
                      default=False,
                      help="Run the profiler on main()")
    log.addlogopts(optprs)

    (options, args) = optprs.parse_args(sys.argv[1:])

    # Are we debugging this?
    if options.debug:
        import pdb

        pdb.run('main(options, args)')

    # Are we profiling this?
    elif options.profile:
        import profile

        print(("%s profile:" % sys.argv[0]))
        profile.run('main(options, args)')
コード例 #7
0
ファイル: clocks.py プロジェクト: mfwofford/ginga
                        dest="show_colors",
                        default=False,
                        action="store_true",
                        help="Show a list of valid colors")
    argprs.add_argument("--show-timezones",
                        dest="show_timezones",
                        default=False,
                        action="store_true",
                        help="Show a list of valid time zones and exit")
    argprs.add_argument("-t",
                        "--toolkit",
                        dest="toolkit",
                        metavar="NAME",
                        default='qt',
                        help="Choose GUI toolkit (gtk|qt)")
    log.addlogopts(argprs)

    options = argprs.parse_args()
    args = options.args

    if options.show_timezones:
        for timezone in pytz.all_timezones:
            print(timezone)
        sys.exit(0)

    if options.show_colors:
        names = colors.get_colors()
        for color in names:
            print(color)
        sys.exit(0)
コード例 #8
0
 def add_default_options(self, optprs):
     """
     Adds the default reference viewer startup options to an
     OptionParser instance `optprs`.
     """
     optprs.add_option("-c",
                       "--completed",
                       dest="completed",
                       default=None,
                       metavar="FILE",
                       help="Specify FILE of completed OB keys")
     optprs.add_option(
         "--date-start",
         dest="date_start",
         default=None,
         help="Define the start of the schedule ('YYYY-MM-DD HH:MM')")
     optprs.add_option(
         "--date-stop",
         dest="date_stop",
         default=None,
         help="Define the end of the schedule ('YYYY-MM-DD HH:MM')")
     optprs.add_option("--debug",
                       dest="debug",
                       default=False,
                       action="store_true",
                       help="Enter the pdb debugger on main()")
     optprs.add_option("--display",
                       dest="display",
                       metavar="HOST:N",
                       help="Use X display on HOST:N")
     optprs.add_option("-g",
                       "--geometry",
                       dest="geometry",
                       metavar="GEOM",
                       default=None,
                       help="X geometry for initial size and placement")
     optprs.add_option("-i",
                       "--input",
                       dest="input_dir",
                       default=".",
                       metavar="DIRECTORY",
                       help="Read input files from DIRECTORY")
     optprs.add_option("-f",
                       "--format",
                       dest="input_fmt",
                       default=None,
                       metavar="FILE_FORMAT",
                       help="Specify input file format (csv, xls, or xlsx)")
     optprs.add_option("--norestore",
                       dest="norestore",
                       default=False,
                       action="store_true",
                       help="Don't restore the GUI from a saved layout")
     ## optprs.add_option("--modules", dest="modules", metavar="NAMES",
     ##                   help="Specify additional modules to load")
     optprs.add_option("--numthreads",
                       dest="numthreads",
                       type="int",
                       default=30,
                       help="Start NUM threads in thread pool",
                       metavar="NUM")
     optprs.add_option("-o",
                       "--output",
                       dest="output_dir",
                       default=None,
                       metavar="DIRECTORY",
                       help="Write output files to DIRECTORY")
     optprs.add_option("--profile",
                       dest="profile",
                       action="store_true",
                       default=False,
                       help="Run the profiler on main()")
     optprs.add_option("-s",
                       "--site",
                       dest="sitename",
                       metavar="NAME",
                       default='subaru',
                       help="Observing site NAME")
     optprs.add_option("-t",
                       "--toolkit",
                       dest="toolkit",
                       metavar="NAME",
                       default=None,
                       help="Prefer GUI toolkit (default: choose one)")
     log.addlogopts(optprs)