123456789101112131415161718192021222324252627282930313233 |
- import sys
- import importlib
- actions = [ 'read', 'write', 'delays', 'update', 'pin', 'reset' ]
- argv = sys.argv
- if len(argv) < 2 or argv[1] not in actions:
- print("Usage: %s [action] ..." % (argv[0]))
- print("Actions: ", end="")
- print(", ".join(str(x) for x in actions))
- sys.exit(1)
- mod = importlib.import_module('greaseweazle.tools.' + argv[1])
- main = mod.__dict__['main']
- res = main(argv)
- if res is None:
- res = 0
- sys.exit(res)
-
|