Advertisement
Azelphur

Untitled

May 30th, 2011
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1. #!/usr/bin/python3
  2.  
  3. from optparse import OptionParser
  4. import libmanage
  5.  
  6. def main():
  7.     parser = OptionParser("usage: %prog [options] command args")
  8.     """parser.add_option("-f", "--file", dest="filename",
  9.               help="read data from FILENAME")
  10.     parser.add_option("-v", "--verbose",
  11.               action="store_true", dest="verbose")
  12.     parser.add_option("-q", "--quiet",
  13.               action="store_false", dest="verbose")"""
  14.     (options, args) = parser.parse_args()
  15.  
  16.     if args[0] == 'addon':
  17.         addon = libmanage.Addon()
  18.         if args[1] == 'get':
  19.             addon.get(args[2], args[3])
  20.         elif args[1] == 'scan':
  21.             addon.generateInstallData(args[2])
  22.     elif args[0] == 'server':
  23.         server = libmanage.Server()
  24.         if args[1] == 'deploy':
  25.             server.deploy(args[2], args[3], args[4], args[5])
  26.         elif args[1] == 'start':
  27.             server.start(args[2])
  28.         elif args[2] == 'stop':
  29.             server.stop(args[2])
  30.  
  31. if __name__ == "__main__":
  32.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement