예제 #1
0
파일: main.py 프로젝트: pombredanne/maxify
def main():
    parser = argparse.ArgumentParser(description="Maxify programmer time "
                                                 "tracker client")
    parser.add_argument("-p",
                        "--project",
                        help="Name of project to start tracking time against "
                             "once the client starts. For a project belonging "
                             "to a particular organization, prefix the name "
                             "with the organization, like: scopetastic/maxify.")
    parser.add_argument("-f",
                        "--data-file",
                        default="maxify.db",
                        help="Path to Maxify data file. By default, this is "
                             "'maxify.db' in the current directory.")
    parser.add_argument("-x",
                        "--debug",
                        action="store_true",
                        help="Print debugging statements during execution.")
    parser.add_argument("command",
                        nargs=argparse.REMAINDER,
                        help="Optional command to execute at startup and then "
                             "exit.")

    args = parser.parse_args()

    if args.debug:
        enable_loggers()

    colorama.init()
    Repository.init(args.data_file)

    interpreter = MaxifyCmd()
    interpreter.cmdloop(args)
예제 #2
0
    def cmd_thread():
        c = MaxifyCmd(stdin=stdin, stdout=stdout, use_color=False)
        c.prompt = ""
        c.use_rawinput = False
        c.completekey = None

        c.cmdloop()