Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(24)  |  Call(12)  |  Derive(0)  |  Import(12)

        def simple_options(parser_fn, version, dependencies, input_required=True):
    parser = parser_fn()
    (options, args) = parser.parse_args()

    if options.output_version:
        standard_output_version(version, dependencies, getattr(options, 'output', None))
        exit(0)

    if input_required:
        # Not all tools have an input file, so we print help for no args as well.
        try:
            if options.input is None:
                print "ERROR: no input files specified"
                parser.print_help()
                exit(1)
        except AttributeError:
            if len(args) == 0:
                print "ERROR: no input files specified"
                parser.print_help()
                exit(1)

    # Not all tools have a metrics option.
    try:
        metrics = options.metrics
    except AttributeError:
        metrics = False

    if options.silent:
        logging.basicConfig(level=logging.CRITICAL)
    elif options.verbose or metrics:
        logging.basicConfig(level=logging.INFO)
    else:
        logging.basicConfig(level=logging.WARNING)

    return (options, args, parser)
        


src/t/u/turbulenz_tools-1.0.5/turbulenz_tools/tools/makehtml.py   turbulenz_tools(Download)
 
from turbulenz_tools.tools.toolsexception import ToolsException
from turbulenz_tools.tools.stdtool import simple_options
 
__version__ = '1.8.0'
def main():
 
    (options, args, parser) = simple_options(_parser, __version__,
                                             __dependencies__, input_required=False)
 

src/t/u/turbulenz_tools-HEAD/turbulenz_tools/tools/makehtml.py   turbulenz_tools(Download)
 
from turbulenz_tools.tools.toolsexception import ToolsException
from turbulenz_tools.tools.stdtool import simple_options
 
__version__ = '1.8.0'
def main():
 
    (options, args, parser) = simple_options(_parser, __version__,
                                             __dependencies__, input_required=False)
 

src/t/u/turbulenz_tools-1.0.5/turbulenz_tools/tools/xml2json.py   turbulenz_tools(Download)
 
from turbulenz_tools.utils.xml_json import xml2json
from turbulenz_tools.tools.stdtool import simple_options
 
__version__ = '1.0.0'
def main():
    (options, args_, parser_) = simple_options(_parser, __version__, __dependencies__)
 
    try:
        with open(options.input) as xml_file:

src/t/u/turbulenz_tools-1.0.5/turbulenz_tools/tools/maketzjs.py   turbulenz_tools(Download)
 
from turbulenz_tools.tools.toolsexception import ToolsException
from turbulenz_tools.tools.stdtool import simple_options
 
from logging import getLogger
def main():
    (options, args, parser) = simple_options(_parser, __version__,
                                             __dependencies__)
 
    Profiler.start('main')

src/t/u/turbulenz_tools-1.0.5/turbulenz_tools/tools/json2txt.py   turbulenz_tools(Download)
 
from turbulenz_tools.utils.disassembler import Json2htmlRenderer, Json2txtRenderer, Json2txtColourRenderer, Disassembler
from turbulenz_tools.tools.stdtool import simple_options
 
__version__ = '1.0.0'
def main():
    (options, args_, parser_) = simple_options(_parser, __version__, __dependencies__)
 
    source_file = options.input
 

src/t/u/turbulenz_tools-1.0.5/turbulenz_tools/tools/json2tar.py   turbulenz_tools(Download)
from optparse import OptionParser, TitledHelpFormatter
 
from turbulenz_tools.tools.stdtool import simple_options
 
__version__ = '1.0.0'
def main():
    (options, args_, parser_) = simple_options(_parser, __version__, __dependencies__)
 
    # Cleanly handle asset location
    asset_root = options.asset_root.replace('\\', '/').rstrip('/')

src/t/u/turbulenz_tools-1.0.5/turbulenz_tools/tools/json2stats.py   turbulenz_tools(Download)
 
from turbulenz_tools.utils.json_stats import analyse_json
from turbulenz_tools.tools.stdtool import simple_options
 
__version__ = '1.0.0'
def main():
    (options, args, parser_) = simple_options(_parser, __version__, __dependencies__)
 
    divider = "+-------------------------+----------------------+---------------+------------------------+"
    if options.header:

src/t/u/turbulenz_tools-HEAD/turbulenz_tools/tools/xml2json.py   turbulenz_tools(Download)
 
from turbulenz_tools.utils.xml_json import xml2json
from turbulenz_tools.tools.stdtool import simple_options
 
__version__ = '1.0.0'
def main():
    (options, args_, parser_) = simple_options(_parser, __version__, __dependencies__)
 
    try:
        with open(options.input) as xml_file:

src/t/u/turbulenz_tools-HEAD/turbulenz_tools/tools/maketzjs.py   turbulenz_tools(Download)
 
from turbulenz_tools.tools.toolsexception import ToolsException
from turbulenz_tools.tools.stdtool import simple_options
 
from logging import getLogger
def main():
    (options, args, parser) = simple_options(_parser, __version__,
                                             __dependencies__)
 
    Profiler.start('main')

src/t/u/turbulenz_tools-HEAD/turbulenz_tools/tools/json2txt.py   turbulenz_tools(Download)
 
from turbulenz_tools.utils.disassembler import Json2htmlRenderer, Json2txtRenderer, Json2txtColourRenderer, Disassembler
from turbulenz_tools.tools.stdtool import simple_options
 
__version__ = '1.0.0'
def main():
    (options, args_, parser_) = simple_options(_parser, __version__, __dependencies__)
 
    source_file = options.input
 

  1 | 2  Next