本文整理汇总了Python中Bcfg2.Server.Plugins.Cfg.CfgGenerator.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python CfgGenerator.__init__方法的具体用法?Python CfgGenerator.__init__怎么用?Python CfgGenerator.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bcfg2.Server.Plugins.Cfg.CfgGenerator
的用法示例。
在下文中一共展示了CfgGenerator.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import __init__ [as 别名]
def __init__(self, fname, spec, encoding):
CfgGenerator.__init__(self, fname, spec, encoding)
if not have_genshi:
msg = "Cfg: Genshi is not available: %s" % fname
logger.error(msg)
raise Bcfg2.Server.Plugin.PluginExecutionError(msg)
self.loader = self.__loader_cls__()
self.template = None
示例2: __init__
# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import __init__ [as 别名]
def __init__(self, fname, spec):
CfgGenerator.__init__(self, fname, spec)
if not HAS_JINJA2:
raise PluginExecutionError("Jinja2 is not available")
self.template = None
encoding = Bcfg2.Options.setup.encoding
self.loader = self.__loader_cls__('/',
encoding=encoding)
self.environment = self.__environment_cls__(loader=self.loader)
示例3: __init__
# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import __init__ [as 别名]
def __init__(self, fname, spec):
CfgGenerator.__init__(self, fname, spec)
if not HAS_JINJA2:
raise PluginExecutionError("Jinja2 is not available")
self.template = None
encoding = Bcfg2.Options.setup.encoding
self.loader = self.__loader_cls__("/", encoding=encoding)
try:
# keep_trailing_newline is new in Jinja2 2.7, and will
# fail with earlier versions
self.environment = self.__environment_cls__(loader=self.loader, keep_trailing_newline=True)
except TypeError:
self.environment = self.__environment_cls__(loader=self.loader)
示例4: __init__
# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import __init__ [as 别名]
def __init__(self, fname, spec, encoding):
CfgGenerator.__init__(self, fname, spec, encoding)
if not HAS_GENSHI:
raise PluginExecutionError("Genshi is not available")
self.template = None
self.loader = self.__loader_cls__(max_cache_size=0)
示例5: __init__
# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import __init__ [as 别名]
def __init__(self, fname, spec, encoding):
CfgGenerator.__init__(self, fname, spec, encoding)
if not have_cheetah:
msg = "Cfg: Cheetah is not available: %s" % entry.get("name")
logger.error(msg)
raise Bcfg2.Server.Plugin.PluginExecutionError(msg)
示例6: __init__
# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import __init__ [as 别名]
def __init__(self, fname, spec, encoding):
CfgGenerator.__init__(self, fname, spec, encoding)
if not HAS_CRYPTO:
raise PluginExecutionError("M2Crypto is not available")
示例7: __init__
# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import __init__ [as 别名]
def __init__(self, fname, spec, encoding):
CfgGenerator.__init__(self, fname, spec, encoding)
if not HAS_CRYPTO:
msg = "Cfg: M2Crypto is not available"
LOGGER.error(msg)
raise PluginExecutionError(msg)
示例8: __init__
# 需要导入模块: from Bcfg2.Server.Plugins.Cfg import CfgGenerator [as 别名]
# 或者: from Bcfg2.Server.Plugins.Cfg.CfgGenerator import __init__ [as 别名]
def __init__(self, fname, spec):
CfgGenerator.__init__(self, fname, spec)
if not HAS_CHEETAH:
raise PluginExecutionError("Cheetah is not available")