def __init__(self, **kwds): Plugin.__init__(self, **kwds) #super(ManagedSingletonPlugin,self).__init__(**kwds) declare_option(name=self.name, section="Services", local_name="enable", default=self._enable, cls=BoolOption, doc="Option that controls behavior of service %s." % self.name)
def __init__(self, **kwds): if getattr(self, '_initialized', False) is True: return self._initialized = True # kwds['name'] = 'TempfileManager' ManagedSingletonPlugin.__init__(self, **kwds) self._tempfiles = [[]] declare_option("tempdir", default=None) self._ctr = -1
def __init__(self, **kwds): Plugin.__init__(self, **kwds) #super(ManagedSingletonPlugin,self).__init__(**kwds) declare_option( name=self.name, section="Services", local_name="enable", default=self._enable, cls=BoolOption, doc="Option that controls behavior of service %s." % self.name)
class TMP_dict2(Plugin): declare_option("options", DictOption) declare_option("b", local_name="o1") declare_option("c", local_name="o2", default=3)
class TMP_dict1(Plugin): declare_option("options", DictOption) declare_option("b") declare_option("c", default=3)
class TMP_float(Plugin): declare_option("o1", cls=FloatOption)
class TMP_int(Plugin): declare_option("o1", cls=IntOption)
class TMP_bool(Plugin): declare_option("o1", cls=BoolOption)
class TMP_repr(Plugin): declare_option("o1", default=4) declare_option("o2", section="foo", default=4)
class TMP_path(Plugin): declare_option("o1", cls=FileOption, default=o1_default, directory="/dev/null")
class TMP_set_get1(Plugin): ep = ExtensionPoint(IDummyOption) declare_option("foo", local_name="opt", default=4, cls=DummyOption1)
def __init__(self): declare_option("a") declare_option("b", cls=FileOption) declare_option("c") declare_option("xx", section_re='globals.*')
def __init__(self): declare_option("a") declare_option("b", local_name="bb") declare_option("b") declare_option("c") declare_option("zz", section='a.b') declare_option("yy", default="foo")
def __init__(self, namespace): """Initialize logging information for a specified namespace""" self._hdlr = None self.namespace = namespace self.env_plugins = ExtensionPoint(IEnvironmentConfig) if self.namespace == "": section = "logging" section_re = None else: section = "logging." + namespace section_re = "^logging$" # declare_option("timestamp", section=section, section_re=section_re, default=False, doc="""Add timestamp to logging information.""") # declare_option("log_dir", section=section, section_re=section_re, default=None, doc="""The logging directory. The default directory is the application directory plus 'log'.""") # declare_option("log_type", section=section, section_re=section_re, default='none', doc="""Logging facility to use. Should be one of (`none`, `file`, `stderr`, `syslog`, `winlog`).""") # declare_option( "log_file", section=section, section_re=section_re, default=namespace + '.log', doc= """If `log_type` is `file`, this should be a path to the log-file.""" ) # declare_option("log_level", section=section, section_re=section_re, default='WARN', doc="""Level of verbosity in log. Should be one of (`CRITICAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`).""") # declare_option("log_format", section=section, section_re=section_re, default=None, doc="""Custom logging format. If nothing is set, the following will be used: $(project)[$(env) $(module)] $(levelname): $(message) In addition to regular key names supported by the Python logger library library (see http://docs.python.org/lib/node422.html), one could use: - $(path)s the path for the current environment - $(basename)s the last path component of the current environment - $(app)s the name of the current application Note the usage of `$(...)s` instead of `%(...)s` as the latter form would be interpreted by the ConfigParser itself. """)
def __init__(self, namespace): """Initialize logging information for a specified namespace""" self._hdlr = None self.namespace = namespace self.env_plugins = ExtensionPoint(IEnvironmentConfig) if self.namespace == "": section = "logging" section_re = None else: section = "logging." + namespace section_re = "^logging$" # declare_option( "timestamp", section=section, section_re=section_re, default=False, doc="""Add timestamp to logging information.""") # declare_option( "log_dir", section=section, section_re=section_re, default=None, doc="""The logging directory. The default directory is the application directory plus 'log'.""") # declare_option( "log_type", section=section, section_re=section_re, default='none', doc="""Logging facility to use. Should be one of (`none`, `file`, `stderr`, `syslog`, `winlog`).""") # declare_option( "log_file", section=section, section_re=section_re, default=namespace + '.log', doc="""If `log_type` is `file`, this should be a path to the log-file.""") # declare_option( "log_level", section=section, section_re=section_re, default='WARN', doc="""Level of verbosity in log. Should be one of (`CRITICAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`).""") # declare_option( "log_format", section=section, section_re=section_re, default=None, doc="""Custom logging format. If nothing is set, the following will be used: $(project)[$(env) $(module)] $(levelname): $(message) In addition to regular key names supported by the Python logger library library (see http://docs.python.org/lib/node422.html), one could use: - $(path)s the path for the current environment - $(basename)s the last path component of the current environment - $(app)s the name of the current application Note the usage of `$(...)s` instead of `%(...)s` as the latter form would be interpreted by the ConfigParser itself. """)
def __init__(self, namespace): self.namespace = namespace self.p = re.compile(namespace) declare_option("options", cls=DictOption, section=namespace)
class TMP_OptionPlugin(Plugin): declare_option("o1")
class TMP_set_get2(Plugin): ep = ExtensionPoint(IOption) declare_option("foo", local_name="o1", default=4) declare_option("foo", local_name="o2", default=4)
def __init__(self, section): declare_option("o1", section=section, default=4)