Small doc chg
[systematiki.git] / systematiki_server.py
blobde08ca6e9d9744dcc4523d9d4c4f9c0556a4f838
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 """
4 Systematiki Server.
5 """
7 # Copyright (C) 2007 Felix Rabe <public@felixrabe.textdriven.com>
8 # Copyright (C) 2007 Alexander Botero-Lowry
10 # This library is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU Lesser General Public
12 # License as published by the Free Software Foundation; either
13 # version 2.1 of the License, or (at your option) any later version.
15 # This library is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 # Lesser General Public License for more details.
20 # You should have received a copy of the GNU Lesser General Public License
21 # along with this library; if not, write to the Free Software Foundation,
22 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 # Recommended line length or text width: 75 characters.
26 import optparse
29 def main(argv):
30 option_parser = optparse.OptionParser(prog = "Systematiki Server")
32 option_parser.add_option("-g", "--use-gtk", dest = "use_gtk",
33 help = "configure using a GTK interface",
34 default = False, action = "store-true")
36 option_parser.add_option("-d", "--database", dest = "db_root",
37 help = "Systematiki database path",
38 default = "Examples/todo-list/")
40 option_parser.add_option("-p", "--port", dest = "port", type = "int",
41 help = "port to listen on",
42 default = 2357)
44 options, args = option_parser.parse_args(argv[1:])
46 if options.use_gtk:
47 from Systematiki.Server.UI.GTK import UserInterface
48 else:
49 from Systematiki.Server.UI.CommandLine import UserInterface
50 UserInterface(options, args).run()
52 return 0
55 if __name__ == "__main__":
56 import sys
57 sys.exit(main(sys.argv))