test
This commit is contained in:
parent
ce9ef93c5a
commit
e382ab5740
@ -22,19 +22,19 @@ class Commands():
|
||||
@property
|
||||
def multi_split_key(self):
|
||||
# TODO config
|
||||
# return self.config.spiceBot.multi_split_key
|
||||
return self.config.spicebot.multi_split_key
|
||||
return "&&"
|
||||
|
||||
@property
|
||||
def pipe_split_key(self):
|
||||
# TODO config
|
||||
# return self.config.spiceBot.pipe_split_key
|
||||
return self.config.spicebot.pipe_split_key
|
||||
return "|"
|
||||
|
||||
@property
|
||||
def query_command_key(self):
|
||||
# TODO config
|
||||
# return self.config.spiceBot.query_command_key
|
||||
return self.config.spicebot.query_command_key
|
||||
return "?"
|
||||
|
||||
@property
|
||||
|
||||
@ -6,7 +6,7 @@ import os
|
||||
|
||||
from sopel.cli.run import build_parser, get_configuration
|
||||
|
||||
# from sopel.config.types import StaticSection, ValidatedAttribute
|
||||
from sopel.config.types import StaticSection, ValidatedAttribute
|
||||
|
||||
|
||||
class Config():
|
||||
@ -47,8 +47,8 @@ class Config():
|
||||
return None
|
||||
|
||||
|
||||
# class SpiceBot_Conf(StaticSection):
|
||||
class SpiceBot_Conf(StaticSection):
|
||||
|
||||
# multi_split_key = ValidatedAttribute('multi_split_key', default="&&")
|
||||
# pipe_split_key = ValidatedAttribute('pipe_split_key', default="|")
|
||||
# query_command_key = ValidatedAttribute('query_command_key', default="?")
|
||||
multi_split_key = ValidatedAttribute('multi_split_key', default="&&")
|
||||
pipe_split_key = ValidatedAttribute('pipe_split_key', default="|")
|
||||
query_command_key = ValidatedAttribute('query_command_key', default="?")
|
||||
|
||||
@ -8,19 +8,20 @@ import os
|
||||
import pathlib
|
||||
|
||||
from .SBCore import SpiceBotCore_OBJ
|
||||
# from .SBCore.config import SpiceBot_Conf
|
||||
from .SBCore.config import SpiceBot_Conf
|
||||
|
||||
SCRIPT_DIR = pathlib.Path(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
sb = SpiceBotCore_OBJ(SCRIPT_DIR)
|
||||
|
||||
|
||||
# def configure(config):
|
||||
# config.define_section("spiceBot", SpiceBot_Conf, validate=False)
|
||||
# config.SpiceBot_Conf.configure_setting('multi_split_key', 'key to split multi-commands')
|
||||
# config.SpiceBot_Conf.configure_setting('pipe_split_key', 'key to split multi-commands')
|
||||
# config.SpiceBot_Conf.configure_setting('query_command_key', 'key to split multi-commands')
|
||||
def configure(config):
|
||||
config.define_section("spiceBot", SpiceBot_Conf, validate=False)
|
||||
config.SpiceBot_Conf.configure_setting('multi_split_key', 'key to split multi-commands')
|
||||
config.SpiceBot_Conf.configure_setting('pipe_split_key', 'key to split multi-commands')
|
||||
config.SpiceBot_Conf.configure_setting('query_command_key', 'key to split multi-commands')
|
||||
|
||||
|
||||
def setup(bot):
|
||||
print(bot.config.spicebot.multi_split_key)
|
||||
sb.setup(bot)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user