コード例 #1
0
    def setUp(self):

        from rhobot.components import register_core_plugins

        register_core_plugins()

        self.session = {}
        self.stream_start(plugins=['rho_bot_scheduler', 'rho_bot_configuration', 'rho_bot_roster',
                                   'export_configuration', ])

        self.scheduler = self.xmpp['rho_bot_scheduler']
        self.configuration = self.xmpp['rho_bot_configuration']
        self.roster = self.xmpp['rho_bot_roster']
        self.export_configuration = self.xmpp['export_configuration']

        self.scheduler.plugin_init()
        self.configuration.plugin_init()
        self.roster.plugin_init()
        self.export_configuration.plugin_init()

        self.scheduler.post_init()
        self.configuration.post_init()
        self.roster.post_init()
        self.export_configuration.post_init()

        # Set the room details in the muc plugin.
        self.xmpp['xep_0045'].ourNicks['room@host'] = 'room_nick'
コード例 #2
0
    def setUp(self):
        from rhobot.components import register_core_plugins

        register_core_plugins()

        self.session = {}
        self.stream_start(plugins=['rho_bot_scheduler', ])
        self.scheduler = self.xmpp['rho_bot_scheduler']
コード例 #3
0
    def setUp(self):
        from rhobot.components import register_core_plugins
        register_core_plugins()

        self.session = {}
        self.stream_start(plugins=['xep_0060', 'rho_bot_scheduler', 'rho_bot_configuration', ])
        self.scheduler = self.xmpp['rho_bot_scheduler']

        self.xmpp['rho_bot_configuration'].plugin_init()
コード例 #4
0
    def setUp(self):
        from rhobot.components import register_core_plugins
        register_core_plugins()

        self.session = {}
        self.stream_start(plugins=['rho_bot_storage_client', ])
        self.scheduler = self.xmpp['rho_bot_scheduler']
        self.storage_client = self.xmpp['rho_bot_storage_client']

        self.scheduler.plugin_init()
        self.storage_client.plugin_init()
        self.storage_client.post_init()
コード例 #5
0
    def setUp(self):
        from rhobot.components import register_core_plugins

        register_core_plugins()

        self.session = {}
        self.stream_start(
            plugins=[
                "xep_0050",
                "rho_bot_scheduler",
                "rho_bot_configuration",
                "rho_bot_roster",
                "rho_bot_rdf_publish",
                "rho_bot_storage_client",
                "rho_bot_representation_manager",
            ]
        )

        self.scheduler = self.xmpp["rho_bot_scheduler"]
        self.rdf_publish = self.xmpp["rho_bot_rdf_publish"]
        self.storage_client = self.xmpp["rho_bot_storage_client"]
        self.rho_bot_representation_manager = self.xmpp["rho_bot_representation_manager"]
        self.roster = self.xmpp["rho_bot_roster"]

        self.scheduler.plugin_init()
        self.storage_client.plugin_init()
        self.rdf_publish.plugin_init()
        # self.rho_bot_representation_manager.plugin_init()

        self.scheduler.post_init()
        self.storage_client.post_init()
        self.rdf_publish.post_init()
        self.rho_bot_representation_manager.post_init()

        def get_uri(self):
            """
            Return the URI for this bot.
            :return:
            """
            return "xmpp:%s" % self.boundjid.bare

        self.xmpp.__class__.get_uri = get_uri
        self.xmpp.name = "Bot Name"

        # Configure all of the plugins as necessary.
        self.roster._channel_name = "*****@*****.**"
コード例 #6
0
ファイル: bot.py プロジェクト: rerobins/rhobot_framework
import logging
import sleekxmpp
from rhobot import configuration
from rhobot.components import register_core_plugins


# Register all of the core plugins.
register_core_plugins()

# Configure the logging for this file.
logger = logging.getLogger(__name__)


class RhoBot(sleekxmpp.ClientXMPP):

    required_plugins = ["rho_bot_roster", "xep_0199"]

    def __init__(self):
        # Set up the configuration details to call the super constructor.
        jid = configuration.get_configuration().get(configuration.CONNECTION_SECTION_NAME, configuration.JID_KEY)
        password = configuration.get_configuration().get(
            configuration.CONNECTION_SECTION_NAME, configuration.PASSWORD_KEY
        )

        logger.info("Attempting to configure with: %s %s" % (jid, password))

        sleekxmpp.ClientXMPP.__init__(self, jid, password)

        # Set up the configuration details for the name of the bot.
        self.name = configuration.get_configuration().get(configuration.BOT_SECTION_NAME, configuration.NAME_KEY)