Trees | Indices | Help |
|
---|
|
1 # -*- coding: UTF-8 -*- 2 ########################################################################### 3 # Eole NG - 2007 4 # Copyright Pole de Competence Eole (Ministere Education - Academie Dijon) 5 # Licence CeCill cf /root/LicenceEole.txt 6 # eole@ac-dijon.fr 7 ########################################################################### 8 9 """ 10 Plugin pour TwistedMatrix et C{mktap}/C{twistd}. 11 """ 12 13 import gettext, locale, os, sys 14 from twisted.python import usage, log # twisted command-line processing & logging 15 16 # install locales early 17 from zephir.monitor.agentmanager import ZEPHIRAGENTS_DATADIR 18 APP = 'zephir-agents' 19 DIR = os.path.join(ZEPHIRAGENTS_DATADIR, 'i18n') 20 gettext.install(APP, DIR, unicode=False) 21 22 from zephir.monitor.agentmanager import config as cfg, util 23 from zephir.monitor.agentmanager.zephirservice import ZephirService 24 2527 optParameters = [ 28 ["config", None, cfg.DEFAULT_CONFIG['config_dir'], 29 _("Directory to search for configurations when loading agents")], 30 ["data", None, cfg.DEFAULT_CONFIG['state_dir'], 31 _("Directory where state data will be stored")], 32 ["archive", None, cfg.DEFAULT_CONFIG['uucp_dir'], 33 _("Directory where the upload archive will be created")], 34 ["static", None, cfg.DEFAULT_CONFIG['static_web_dir'], 35 _("Directory for static web data (graphics, stylesheets...)")], 36 ["static-base", None, cfg.DEFAULT_CONFIG['static_base_url'], 37 _("Base URL path for static web data")], 38 ["tmp", None, cfg.DEFAULT_CONFIG['tmp_data_dir'], 39 _("Temporary folder for archiving data")], 40 ]41 4244 setup_logger() 45 config = setup_config(commandline_config) 46 # setup_filesystem_env() 47 return ZephirService(config,serve_static=True).with_updater_and_publisher()48 4951 """Change stuff in C{cfg}""" 52 53 config = cfg.DEFAULT_CONFIG.copy() 54 # this could use some os.path.expanduser() and os.path.expandvars() 55 config['config_dir'] = util.expand_dirname(commandline_config["config"]) 56 config['state_dir'] = util.expand_dirname(commandline_config["data"]) 57 config['uucp_dir'] = util.expand_dirname(commandline_config["archive"]) 58 config['static_web_dir'] = util.expand_dirname(commandline_config["static"]) 59 config['tmp_data_dir'] = util.expand_dirname(commandline_config["tmp"]) 60 config['static_base_url'] = commandline_config["static-base"] 61 return config62 63 66 67 68 # def setup_filesystem_env(): 69 # if not cfg.create_filesystem_env: 70 # os.makedirs(cfg.data_dir) 71
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Mon Oct 1 23:57:04 2007 | http://epydoc.sourceforge.net |