#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import loader
if __name__ == '__main__':
    argparser = argparse.ArgumentParser(description='Process source (for example, a file) that will be parsed for content into a data structure')
    argparser.add_argument('source',
        metavar='N',
        type=str,
        help='Source from which we will parse and format the general content')
    argparser.add_argument('-p', '--parser',
        type=str,
        help='Parser from which we will parse the source',
        required=True)
    argparser.add_argument('-f', '--formatter',
        type=str,
        help='Formatter from which we will format the parsed source',
        required=True)
    argparser.add_argument('-a', '--app',
        type=str,
        help='The app which will accept the parsed and formatted content',
        required=True)
    argparser.add_argument('-pe', '--persist',
        action='store_true',
        default=False,
        help='Persists results of parsing/formatting to database. Requires a valid dialect.')
    args = argparser.parse_args()

    loader.load_app(args.app, args.source, args.parser, args.formatter, args.persist)
    # safe_module = common.path_leaf(args.app)
    # if not safe_module.startswith("core.apps"):
    #     safe_module.replace(".", "")
    #     safe_module = "apps.%s" % safe_module

    # app = importlib.import_module("%s" % safe_module)
    # output = getattr(app, 'execute')(args.source, args.parser, args.formatter)
    # if args.persist:
    #     getattr(app, 'persist')(output)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import loader
if __name__ == '__main__':
    argparser = argparse.ArgumentParser(description='Process source (for example, a file) that will be parsed for content into a data structure')
    argparser.add_argument('source',
        metavar='N',
        type=str,
        help='Source from which we will parse and format the general content')
    argparser.add_argument('-p', '--parser',
        type=str,
        help='Parser from which we will parse the source',
        required=True)
    argparser.add_argument('-f', '--formatter',
        type=str,
        help='Formatter from which we will format the parsed source',
        required=True)
    argparser.add_argument('-a', '--app',
        type=str,
        help='The app which will accept the parsed and formatted content',
        required=True)
    argparser.add_argument('-pe', '--persist',
        action='store_true',
        default=False,
        help='Persists results of parsing/formatting to database. Requires a valid dialect.')
    args = argparser.parse_args()

    loader.load_app(args.app, args.source, args.parser, args.formatter, args.persist)
remove unnecessary