Пример #1
0
def main():
    CLI = Cli()
    SETTINGS = Settings()
    SETTINGS.path = os.path.expanduser(POD_PATH)
    SETTINGS.projectpath = sy.pwd()
    # load command file if in command params
    if len(sys.argv)==2:
        CLI.do_source(sys.argv[1])
    # infinite command loop
    CLI.cmdloop()
Пример #2
0
                    )
    except getopt.GetoptError,e:
        print str(e)
        usage()
        sys.exit(2)
    options = [arg[0] for arg in opts]

    if "help" in options or "-h" in options:
        usage()
        sys.exit(2)

    if "version" in options or "-v" in options:
        print "Peripherals On Demand version "+ ver.getVersion()
        sys.exit(2)

    CLI = Cli()
    SETTINGS = Settings()
    SETTINGS.path = POD_PATH
    SETTINGS.projectpath = sy.pwd()
    SETTINGS.version = ver.getVersion()

    # load command file if in command params
    if "--source" in options or "-s" in options:
        for opt,arg in opts:
            if opt=="--source" or opt=="-s":
                argument = arg
                break
        if not os.path.exists(argument):
            print "[ERROR] script "+str(argument)+\
                " doesn't exist"
            usage()