Changeset 20:bf238ca0c37f in mailjam for mailjam/daemon.py
- Timestamp:
- May 22, 2012, 1:28:15 PM (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mailjam/daemon.py
r16 r20 1 1 # -*- coding: utf-8 -*- 2 3 """ 4 The mailjam project - daemon.py 5 6 This file is released under the BSD license, see LICENSE for 7 more information. 8 9 Francisco de Borja Lopez Rio - <borja@codigo23.net> 10 Soluciones Informaticas Codigo23 S.L.U. - http://codigo23.net 11 """ 2 12 3 13 import os, inspect, logging … … 12 22 13 23 def __init__(self, configfile=None): 24 self.configfile=configfile 14 25 self.storage_config = config.get_config_parameters('storage', 15 26 configfile) … … 54 65 # now load all the mailing objects: 55 66 for address in self.mailings_addresses: 56 mailing = MailingList(address, address) 67 mailing = MailingList(name=address, address=address, 68 configfile=self.configfile) 57 69 mailing.load() 58 70 self.mailings[address] = mailing … … 146 158 """ 147 159 160 def __init__(self, configfile=None): 161 self.configfile = configfile 162 148 163 def _listMethods(self): 149 164 public_methods = [] … … 158 173 159 174 class MailingListXMLRPC(): 160 def __init__(self ):161 self.mailjam = Mailjam( )175 def __init__(self, configfile=None): 176 self.mailjam = Mailjam(configfile=configfile) 162 177 self.mailjam.load() 163 178 def add(self, info={}): … … 168 183 169 184 class MemberXMLRPC(): 170 def __init__(self ):171 self.mailjam = Mailjam( )185 def __init__(self, configfile=None): 186 self.mailjam = Mailjam(configfile=configfile) 172 187 self.mailjam.load() 173 188 def add(self, member_addr=None, list_addr=None): … … 180 195 class MailjamDaemon(): 181 196 def __init__(self, configfile=None): 197 self.configfile = configfile 182 198 self.config = config.get_config_parameters('xmlrpc_server', configfile) 183 184 # FIXME: These should be loaded from a config file185 199 self.address = self.config.get('address', 'localhost') 186 200 self.port = int(self.config.get('port', 9876)) … … 221 235 msg = 'Registering public methods' 222 236 logging.info(msg) 223 root = MailjamXMLRPC( )224 root.lists = MailingListXMLRPC( )225 root.members = MemberXMLRPC( )237 root = MailjamXMLRPC(self.configfile) 238 root.lists = MailingListXMLRPC(self.configfile) 239 root.members = MemberXMLRPC(self.configfile) 226 240 self.server.register_instance(root, allow_dotted_names=True) 227 241 self.ready_to_serve = True
Note:
See TracChangeset
for help on using the changeset viewer.