~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to services/usrmgt-server

  • Committer: William Grant
  • Date: 2009-04-28 06:02:41 UTC
  • Revision ID: grantw@unimelb.edu.au-20090428060241-t4gnwl35maukfvfg
Move ivle.conf.mimetypes to ivle.mimetypes, and rename things in it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import sys
5
5
import logging
6
6
 
 
7
import ivle.config
7
8
import ivle.conf
8
9
import ivle.database
9
10
import ivle.chat
124
125
    }
125
126
 
126
127
def initializer():
 
128
    logging.basicConfig(filename="/var/log/usrmgt.log", level=logging.INFO)
 
129
    logging.info("Starting usrmgt server on port %d (pid = %d)" %
 
130
                 (ivle.conf.usrmgt_port, pid))
 
131
 
127
132
    try:
128
133
        pidfile = open('/var/run/usrmgt-server.pid', 'w')
129
134
        pidfile.write('%d\n' % os.getpid())
135
140
def dispatch(props):
136
141
    logging.debug(repr(props))
137
142
 
138
 
    store = ivle.database.get_store()
 
143
    store = ivle.database.get_store(ivle.config.Config())
139
144
    action = props.keys()[0]
140
145
    res = actions[action](store, props[action])
141
146
 
149
154
if __name__ == "__main__":
150
155
    pid = os.getpid()
151
156
 
152
 
    logging.basicConfig(filename="/var/log/usrmgt.log", level=logging.INFO)
153
 
    logging.info("Starting usrmgt server on port %d (pid = %d)" %
154
 
                 (ivle.conf.usrmgt_port, pid))
155
 
 
156
157
    ivle.chat.start_server(ivle.conf.usrmgt_port, ivle.conf.usrmgt_magic,
157
158
                           True, dispatch, initializer)