Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)
Sets the default options for a plugin.

The names of the arguments in ``kwargs`` will be used as the option names,
the values as the values of the options.

        def set_default_options(**kwargs):
    """Sets the default options for a plugin.

    The names of the arguments in ``kwargs`` will be used as the option names,
    the values as the values of the options.
    """
    plugin = _find_current_plugin_name()
    for key, value in kwargs.iteritems():
        if not _CFG.has_option(plugin, key):
            if not isinstance(value, list):
                _set(plugin, key, value)
            else:
                set_list(key, value, plugin)
        


src/l/a/lala-0.3/lala/plugins/quotes.py   lala(Download)
from functools import partial
from lala.util import command, msg, on_join
from lala.config import get, get_int, set_default_options
from twisted.enterprise import adbapi
 
set_default_options(database_path=os.path.join(os.path.expanduser("~/.lala"),

src/l/a/lala-0.3/lala/plugins/anime.py   lala(Download)
import anidb
import logging
 
from lala.util import command, msg
from lala.config import get_int, set_default_options
 
anidb.set_client("pyanihttp", 1)
set_default_options(max_tags="5", max_search_results="5")

src/l/a/lala-0.3/lala/plugins/last.py   lala(Download)
 
 
lala.config.set_default_options(max_lines="30",
                                datetime_format="%Y-%m-%d %H:%M:%S")
 

src/l/a/lala-0.3/lala/plugins/fortune.py   lala(Download)
 
 
lala.config.set_default_options(fortune_path="/usr/bin/fortune",
                                fortune_files="fortunes")
 

src/l/a/lala-0.3/lala/plugins/log.py   lala(Download)
 
 
lala.config.set_default_options(max_lines="30")
 
 

src/l/a/lala-0.3/test/test_config.py   lala(Download)
    def test_set_default_options(self):
        config.set_default_options(stringkey="foo", defaultintkey="1")
        self.assertEqual(config.get("stringkey"), "foo")
        self.assertEqual(config.get_int("defaultintkey"), 1)
 
    def test_set_default_options_list(self):
        items = ["foo", "bar", "baz"]
        config.set_default_options(defaultlisttest=items)
    def test_default_doesnt_overwrite(self):
        config.set("not_overwritten_key", 1)
        config.set_default_options(not_overwritten_key=2)
        self.assertEquals(config.get_int("not_overwritten_key"), 1)