Mercurial > libervia-web
comparison twisted/plugins/libervia.py @ 433:bbdbee25123a
import constants.Const as C (according to the coding rules)
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 01 May 2014 11:29:09 +0200 |
parents | 8ecc5a7062e4 |
children | fa3b65b68971 |
comparison
equal
deleted
inserted
replaced
432:8ecc5a7062e4 | 433:bbdbee25123a |
---|---|
23 from twisted.plugin import IPlugin | 23 from twisted.plugin import IPlugin |
24 from twisted.application.service import IServiceMaker | 24 from twisted.application.service import IServiceMaker |
25 | 25 |
26 from xdg.BaseDirectory import save_config_path | 26 from xdg.BaseDirectory import save_config_path |
27 from ConfigParser import SafeConfigParser, NoSectionError, NoOptionError | 27 from ConfigParser import SafeConfigParser, NoSectionError, NoOptionError |
28 from sat.core.constants import Const | 28 from sat.core.constants import Const as C |
29 try: | 29 try: |
30 from libervia_server import Libervia | 30 from libervia_server import Libervia |
31 opt_params = Libervia.OPT_PARAMETERS | 31 opt_params = Libervia.OPT_PARAMETERS |
32 except (ImportError, SystemExit): | 32 except (ImportError, SystemExit): |
33 # avoid raising an error when you call twisted and sat is not launched | 33 # avoid raising an error when you call twisted and sat is not launched |
47 - use the values passes on the command line | 47 - use the values passes on the command line |
48 If you do it later: after the command line options have been parsed, there's no good way to know | 48 If you do it later: after the command line options have been parsed, there's no good way to know |
49 if the options values are the hard-coded ones or if they have been passed on the command line. | 49 if the options values are the hard-coded ones or if they have been passed on the command line. |
50 """ | 50 """ |
51 config = SafeConfigParser() | 51 config = SafeConfigParser() |
52 config.read(Const.CONFIG_FILES) | 52 config.read(C.CONFIG_FILES) |
53 for index, param in list(enumerate(self.optParameters)): | 53 for index, param in list(enumerate(self.optParameters)): |
54 # index is only used to not modify the loop variable "param" | 54 # index is only used to not modify the loop variable "param" |
55 name = param[0] | 55 name = param[0] |
56 try: | 56 try: |
57 value = config.get('libervia', name) | 57 value = config.get('libervia', name) |