Mercurial > libervia-web
comparison twisted/plugins/libervia.py @ 417:2bd609d7dd65
server_side: use XDG recommended paths as the defaults
author | souliane <souliane@mailoo.org> |
---|---|
date | Sun, 23 Mar 2014 23:05:23 +0100 |
parents | e9bc7854bce6 |
children | 39b07289ff42 |
comparison
equal
deleted
inserted
replaced
416:e9bc7854bce6 | 417:2bd609d7dd65 |
---|---|
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 os.path import expanduser | 28 from sat.core.constants import Const |
29 | |
30 try: | 29 try: |
31 from libervia_server import Libervia | 30 from libervia_server import Libervia |
32 opt_params = Libervia.OPT_PARAMETERS | 31 opt_params = Libervia.OPT_PARAMETERS |
33 except (ImportError, SystemExit): | 32 except (ImportError, SystemExit): |
34 # 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 |
68 def makeService(self, options): | 67 def makeService(self, options): |
69 return Libervia(**dict(options)) # get rid of the usage.Option overload | 68 return Libervia(**dict(options)) # get rid of the usage.Option overload |
70 | 69 |
71 config_path = save_config_path('sat') | 70 config_path = save_config_path('sat') |
72 config = SafeConfigParser() | 71 config = SafeConfigParser() |
73 config.read(map(expanduser, ['/etc/sat.conf', config_path + '/sat.conf', 'sat.conf', '.sat.conf'])) | 72 config.read(Const.CONFIG_FILES) |
74 | 73 |
75 serviceMaker = LiberviaMaker() | 74 serviceMaker = LiberviaMaker() |