Ejemplo n.º 1
0
def run(argv):
    bauerGlobals = BauerGlobals()

    setupLogging(argv)

    generatorInfo = GeneratorInfo()

    argParser = BauerArgParser(bauerGlobals, generatorInfo)
    argParser.buildBauerArguments(argv)

    args = argParser.parse_args()

    if args == None:
        return

    if args.command == 'new':
        templateCreator = TemplateCreator()
        templateCreator.generate(args)
        return
    if args.command == 'doc':
        doccer = Documentation()
        doccer.run(args)
        return

    rootPath = os.path.abspath(
        os.path.join(os.path.realpath(__file__), "..", ".."))
    source_folder = os.getcwd()

    buildFolder = BuildFolder(bauerGlobals, generatorInfo, source_folder, args)

    commandProcessor = CommandProcessor(bauerGlobals, generatorInfo, args,
                                        rootPath, source_folder, buildFolder)
    commandProcessor.process()
Ejemplo n.º 2
0
def run(argv):
    bauerGlobals = BauerGlobals()

    setupLogging(argv)

    generatorInfo = GeneratorInfo()

    argParser = BauerArgParser(bauerGlobals, generatorInfo)
    argParser.buildBauerArguments(argv)

    args = argParser.parse_args()

    if args == None:
        return

    if args.command == 'new':
        templateCreator = TemplateCreator()
        templateCreator.generate(args)
        return
    if args.command == 'doc':
        doccer = Documentation()
        doccer.run(args)
        return

    rootPath = os.path.abspath(
        os.path.join(os.path.realpath(__file__), "..", ".."))
    source_folder = os.getcwd()

    # Python will switch to the real path when the working dir has a symlink in it.
    # We'll update the current dir and the environment variable to reflect this.
    os.chdir(source_folder)
    os.environ["PWD"] = source_folder

    buildFolder = BuildFolder(bauerGlobals, generatorInfo, source_folder, args)

    commandProcessor = CommandProcessor(bauerGlobals, generatorInfo, args,
                                        rootPath, source_folder, buildFolder)
    commandProcessor.process()