def do(args):
    try:
        worktree = qisys.parsers.get_worktree(args)
    except qisys.worktree.NotInWorkTree:
        worktree = None

    project_name = os.path.basename(args.project_name)

    output_dir = args.output_dir
    if not output_dir:
        output_dir = qisrc.templates.attached_lower(project_name)
        output_dir = os.path.join(os.getcwd(), output_dir)

    if os.path.exists(output_dir):
        raise ui.fatal("%s already exists" % output_dir)

    template_path = args.template_path
    if not template_path:
        template_path = os.path.join(qisrc.QISRC_ROOT_DIR, "templates", "project")

    qisrc.templates.process(template_path, output_dir, project_name=project_name)

    if args.git:
        qisys.command.call(["git", "init"], cwd=output_dir)
        with open(os.path.join(output_dir, ".gitignore"), "w") as fp:
            fp.write("build-*\n")
        qisys.command.call(["git" , "add" , "."], cwd=output_dir)
        qisys.command.call(["git" , "commit" , "-m" , "initial commit"], cwd=output_dir)

    ui.info(ui.green, "New project initialized in", ui.bold,  output_dir)
    if worktree:
        worktree.add_project(output_dir)
        return worktree.get_project(output_dir)
Returns a trait event whose editor is a toolbar button.
dataset/ETHPy150Open aldebaran/qibuild/python/qisrc/actions/create.py/do--crossover with--dataset/ETHPy150Open enthought/traits/traits/trait_types.py/ToolbarButton.__init__