2 # -*- coding: utf-8 -*-
6 The client is called 'systematiki.py'.
9 # Copyright (C) 2007 Felix Rabe <public@felixrabe.textdriven.com>
11 # This library is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU Lesser General Public
13 # License as published by the Free Software Foundation; either
14 # version 2.1 of the License, or (at your option) any later version.
16 # This library is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # Lesser General Public License for more details.
21 # You should have received a copy of the GNU Lesser General Public License
22 # along with this library; if not, write to the Free Software Foundation,
23 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 # Recommended line length or text width: 75 characters.
27 from Systematiki
.Database
.Dummy
import Database
28 from Systematiki
.Networking
.BlockingStringProtocol
import StringProtocol
31 class ServerConfig(object):
33 Server configuration class.
35 TODO: Proper configuration using either command-line arguments,
36 configuration files, or a GUI.
39 def __init__(self
, argv
):
40 self
.host
= "localhost"
42 self
.database_class
= Database
47 database
= config
.database_class(config
)
48 server_proto
= StringProtocol()
49 server_proto
.listen((config
.host
, config
.port
))
50 server_proto
.accept(cli_ui_cb_1
)
53 def cli_ui_cb_1(client_proto
):
58 config
= ServerConfig(argv
) # Might run and quit a gobject.MainLoop
59 if config
.ui
== "cli":
61 # TODO: GTK interface, web interface, brain interface, ...
65 if __name__
== "__main__":
67 sys
.exit(main(sys
.argv
))