1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import optparse
23
24 from twisted.internet import reactor
25 from twisted.python import rebuild
26
27 from flumotion.common import log, errors, worker, planet, common
28
29
30 from flumotion.common import messages
31
32 from flumotion.configure import configure
33 from flumotion.twisted import flavors, reflect
34
35
36
37 from flumotion.admin.text import connection
38 from flumotion.admin.text.greeter import AdminTextGreeter
39
40 import curses
41
43 curses.nocbreak()
44 stdscr.keypad(0)
45 curses.echo()
46 curses.endwin()
47
85
87 parser = optparse.OptionParser()
88 parser.add_option('-d', '--debug',
89 action="store", type="string", dest="debug",
90 help="set debug levels")
91 parser.add_option('-v', '--verbose',
92 action="store_true", dest="verbose",
93 help="be verbose")
94 parser.add_option('', '--version',
95 action="store_true", dest="version",
96 default=False,
97 help="show version information")
98 parser.add_option('-u', '--username',
99 action="store", type="string", dest="username",
100 help="set username to connect to manager")
101 parser.add_option('-P', '--password',
102 action="store", type="string", dest="password",
103 help="set password to connect to manager")
104 parser.add_option('-H', '--hostname',
105 action="store", type="string", dest="hostname",
106 help="set hostname of manager to connect to")
107 parser.add_option('-p', '--port',
108 action="store", type="string", dest="port",
109 help="set port of manager to connect to")
110 parser.add_option('', '--insecure',
111 action="store_true", dest="insecure",
112 help="make insecure connection")
113
114 options, args = parser.parse_args(args)
115
116 if options.version:
117 from flumotion.common import common
118 print common.version("flumotion-admin-text")
119 return 0
120
121 if options.verbose:
122 log.setFluDebug("*:3")
123
124 if options.debug:
125 log.setFluDebug(options.debug)
126
127
128 _runInterface(options)
129
130 reactor.run()
131