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

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)
Builds and returns the argument parser.
    

        def get_config_args(parser_dict):
    """ Builds and returns the argument parser.
    """

    # Create the new global parser.
    parser = argparse.ArgumentParser(description=parser_dict['description'])

    # Add arguments to the global parser.
    for arg in parser_dict['args']:
        parser.add_argument(*arg['args'], **arg['kwargs'])

    # Iterates over all subparsers.
    if parser_dict['subparsers']:
        subparsers = parser.add_subparsers()
    for item in parser_dict['subparsers']:
        # Add the new subparser.
        subparser = subparsers.add_parser(item['name'], help=item['help'])
        subparser.set_defaults(which=item['name'])

        # Add arguments to the subparser.
        for arg in item['args']:
            subparser.add_argument(*arg['args'], **arg['kwargs'])

    args = parser.parse_args()

    # Ensure the path is an abspath.
    if hasattr(args, 'path') and args.path:
        args.path = abspath(expanduser(args.path))

    # Return a dict, not a Namespace.
    return args.__dict__
        


src/b/a/baboon-0.1.4/baboon/baboond/config.py   baboon(Download)
import argparse
import logging
import logging.config
 
from baboon.common.config import get_config_args, get_config_file
def get_baboond_config():
    """ Returns the baboond full dict configuration.
    """
 
    arg_attrs = get_config_args(PARSER)

src/b/a/baboon-HEAD/baboon/baboond/config.py   baboon(Download)
import argparse
import logging
import logging.config
 
from baboon.common.config import get_config_args, get_config_file
def get_baboond_config():
    """ Returns the baboond full dict configuration.
    """
 
    arg_attrs = get_config_args(PARSER)

src/b/a/baboon-0.1.4/baboon/baboon/config.py   baboon(Download)
from baboon.baboon.fmt import cerr, cwarn, csuccess
from baboon.baboon.dictconf import LOGGING, PARSER
from baboon.common.config import get_config_args, get_config_file
from baboon.common.config import init_config_log
from baboon.common.errors.baboon_exception import ConfigException
def get_baboon_config():
    """ Returns the baboon full dict configuration.
    """
 
    arg_attrs = get_config_args(PARSER)

src/b/a/baboon-HEAD/baboon/baboon/config.py   baboon(Download)
from baboon.baboon.fmt import cerr, cwarn, csuccess
from baboon.baboon.dictconf import LOGGING, PARSER
from baboon.common.config import get_config_args, get_config_file
from baboon.common.config import init_config_log
from baboon.common.errors.baboon_exception import ConfigException
def get_baboon_config():
    """ Returns the baboon full dict configuration.
    """
 
    arg_attrs = get_config_args(PARSER)