mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-12 14:39:54 -05:00
test configuration
This commit is contained in:
parent
81acd5ae49
commit
fdcfe42bf4
@ -4,13 +4,32 @@ from __future__ import unicode_literals, absolute_import, division, print_functi
|
|||||||
This is the SpiceBot Channels system.
|
This is the SpiceBot Channels system.
|
||||||
"""
|
"""
|
||||||
import sopel
|
import sopel
|
||||||
|
from sopel.config.types import StaticSection, ValidatedAttribute, ListAttribute
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
from .Config import config as botconfig
|
||||||
|
from .Events import events
|
||||||
|
from .Logs import logs
|
||||||
|
|
||||||
|
|
||||||
|
class SpiceBot_Channels_MainSection(StaticSection):
|
||||||
|
announcenew = ValidatedAttribute('announcenew', default=False)
|
||||||
|
joinall = ValidatedAttribute('joinall', default=False)
|
||||||
|
operadmin = ValidatedAttribute('operadmin', default=False)
|
||||||
|
chanignore = ListAttribute('chanignore')
|
||||||
|
|
||||||
|
|
||||||
class BotChannels():
|
class BotChannels():
|
||||||
"""This Logs all channels known to the server"""
|
"""This Logs all channels known to the server"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
|
# SpiceBot
|
||||||
|
logs.log('SpiceBot_Channels', "Setting Up BotChannels class")
|
||||||
|
botconfig.define_section("SpiceBot_Channels", SpiceBot_Channels_MainSection, validate=False)
|
||||||
|
events.startup_add([events.BOT_CHANNELS])
|
||||||
|
|
||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
self.channel_lock = False
|
self.channel_lock = False
|
||||||
self.dict = {
|
self.dict = {
|
||||||
|
|||||||
@ -2,15 +2,7 @@
|
|||||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||||
"""Configuration for SpiceBot"""
|
"""Configuration for SpiceBot"""
|
||||||
|
|
||||||
import sopel.module
|
from .Channels import SpiceBot_Channels_MainSection
|
||||||
from sopel.config.types import StaticSection, ValidatedAttribute, ListAttribute
|
|
||||||
|
|
||||||
|
|
||||||
class SpiceBot_Channels_MainSection(StaticSection):
|
|
||||||
announcenew = ValidatedAttribute('announcenew', default=False)
|
|
||||||
joinall = ValidatedAttribute('joinall', default=False)
|
|
||||||
operadmin = ValidatedAttribute('operadmin', default=False)
|
|
||||||
chanignore = ListAttribute('chanignore')
|
|
||||||
|
|
||||||
|
|
||||||
def configure(config):
|
def configure(config):
|
||||||
|
|||||||
@ -2,18 +2,12 @@
|
|||||||
from __future__ import unicode_literals, absolute_import, division, print_function
|
from __future__ import unicode_literals, absolute_import, division, print_function
|
||||||
"""Configuration for SpiceBot"""
|
"""Configuration for SpiceBot"""
|
||||||
|
|
||||||
import sopel.module
|
|
||||||
|
|
||||||
from .Logs import logs
|
from .Logs import logs
|
||||||
from .Events import events
|
|
||||||
from .Config import config as botconfig
|
|
||||||
|
|
||||||
from .configure import SpiceBot_Channels_MainSection
|
from .Channels import SpiceBot_Channels_MainSection
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
|
|
||||||
logs.log('SpiceBot_Channels', "Starting setup procedure")
|
logs.log('SpiceBot_Channels', "Setting Up Configuration")
|
||||||
events.startup_add([events.BOT_CHANNELS])
|
|
||||||
bot.config.define_section("SpiceBot_Channels", SpiceBot_Channels_MainSection, validate=False)
|
bot.config.define_section("SpiceBot_Channels", SpiceBot_Channels_MainSection, validate=False)
|
||||||
botconfig.define_section("SpiceBot_Channels", SpiceBot_Channels_MainSection, validate=False)
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user