comparison src/twisted/plugins/libervia_server.py @ 466:01880aa8ea2d

twisted plugin: fixes the parsing of directory parameter
author souliane <souliane@mailoo.org>
date Mon, 09 Jun 2014 20:37:28 +0200
parents 1a0cec9b0f1e
children 34ce41e014c4
comparison
equal deleted inserted replaced
465:33ec27ef4b6a 466:01880aa8ea2d
30 30
31 # XXX: We need to configure logs before any log method is used, so here is the best place. 31 # XXX: We need to configure logs before any log method is used, so here is the best place.
32 from libervia.server.constants import Const as C 32 from libervia.server.constants import Const as C
33 from sat.core import log_config 33 from sat.core import log_config
34 log_config.satConfigure(C.LOG_BACKEND_TWISTED, C) 34 log_config.satConfigure(C.LOG_BACKEND_TWISTED, C)
35 from sat.tools.config import getConfig
35 36
36 from zope.interface import implements 37 from zope.interface import implements
37 38
38 from twisted.python import usage 39 from twisted.python import usage
39 from twisted.plugin import IPlugin 40 from twisted.plugin import IPlugin
66 config.read(C.CONFIG_FILES) 67 config.read(C.CONFIG_FILES)
67 for index, param in list(enumerate(self.optParameters)): 68 for index, param in list(enumerate(self.optParameters)):
68 # index is only used to not modify the loop variable "param" 69 # index is only used to not modify the loop variable "param"
69 name = param[0] 70 name = param[0]
70 try: 71 try:
71 value = config.get('libervia', name) 72 value = getConfig(config, 'libervia', name)
72 self.optParameters[index][2] = param[4](value) 73 self.optParameters[index][2] = param[4](value)
73 except (NoSectionError, NoOptionError): 74 except (NoSectionError, NoOptionError):
74 pass 75 pass
75 usage.Options.__init__(self) 76 usage.Options.__init__(self)
76 77