Ejemplo n.º 1
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "socket")
     self._host = "0.0.0.0"
     self._port = 80
     self._debug = False
     self._queue = 5
     self._max_buffer = 1024
Ejemplo n.º 2
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "socket")
     self._host = "0.0.0.0"
     self._port = 80
     self._debug = False
     self._queue = 5
     self._max_buffer = 1024
Ejemplo n.º 3
0
    def test_with_data(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        console:
          bot:  bot
          prompt: ">>>"
          license_keys: $BOT_ROOT/config/license.keys
          bot_selector: programy.clients.client.DefaultBotSelector
          renderer: programy.clients.render.text.TextRenderer
          scheduler:
            name: Scheduler1
            debug_level: 0
            add_listeners: True
            remove_all_jobs: True
        """, ConsoleConfiguration(), ".")

        bot_config = yaml.get_section("console")

        client_config = ClientConfigurationData("test")
        client_config.load_configuration(yaml, bot_config, ".")

        self.assertEquals("./config/license.keys", client_config.license_keys)

        self.assertEquals("programy.clients.client.DefaultBotSelector", client_config.bot_selector)

        self.assertIsNotNone(client_config.scheduler)
        self.assertEquals("Scheduler1", client_config.scheduler.name)
        self.assertEquals(0, client_config.scheduler.debug_level)
        self.assertTrue(client_config.scheduler.add_listeners)
        self.assertTrue(client_config.scheduler.remove_all_jobs)

        self.assertEquals("programy.clients.render.text.TextRenderer", client_config.renderer)
Ejemplo n.º 4
0
    def test_with_data(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text(
            """
        console:
          bot:  bot
          prompt: ">>>"
          bot_selector: programy.clients.client.DefaultBotSelector
          renderer: programy.clients.render.text.TextRenderer
          scheduler:
            name: Scheduler1
            debug_level: 0
            add_listeners: True
            remove_all_jobs: True
        """, ConsoleConfiguration(), ".")

        bot_config = yaml.get_section("console")

        client_config = ClientConfigurationData("test")
        client_config.load_configuration(yaml, bot_config, ".")

        self.assertEqual("programy.clients.client.DefaultBotSelector",
                         client_config.bot_selector)

        self.assertIsNotNone(client_config.scheduler)
        self.assertEqual("Scheduler1", client_config.scheduler.name)
        self.assertEqual(0, client_config.scheduler.debug_level)
        self.assertTrue(client_config.scheduler.add_listeners)
        self.assertTrue(client_config.scheduler.remove_all_jobs)

        self.assertEqual("programy.clients.render.text.TextRenderer",
                         client_config.renderer)
Ejemplo n.º 5
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "xmpp")
     self._server = None
     self._port = 5222
     self._xep_0030 = False
     self._xep_0004 = False
     self._xep_0060 = False
     self._xep_0199 = False
Ejemplo n.º 6
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "xmpp")
     self._server = None
     self._port = 5222
     self._xep_0030 = False
     self._xep_0004 = False
     self._xep_0060 = False
     self._xep_0199 = False
Ejemplo n.º 7
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "twitter")
     self._description = 'ProgramY AIML2.0 Twitter Client'
     self._polling_interval = 0
     self._rate_limit_sleep = -1
     self._use_status = False
     self._use_direct_message = False
     self._auto_follow = False
     self._welcome_message = "Thanks for following me."
Ejemplo n.º 8
0
 def __init__(self, name):
     ClientConfigurationData.__init__(self, name)
     self._host = "0.0.0.0"
     self._port = 80
     self._debug = False
     self._use_api_keys = False
     self._api_key_file = None
     self._ssl_cert_file = None
     self._ssl_key_file = None
Ejemplo n.º 9
0
 def __init__(self, name):
     ClientConfigurationData.__init__(self, name)
     self._host = "0.0.0.0"
     self._port = 80
     self._debug = False
     self._use_api_keys = False
     self._api_key_file = None
     self._ssl_cert_file = None
     self._ssl_key_file = None
Ejemplo n.º 10
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "twitter")
     self._polling_interval = 0
     self._rate_limit_sleep = -1
     self._use_status = False
     self._use_direct_message = False
     self._auto_follow = False
     self._storage = None
     self._storage_location = None
     self._welcome_message = "Thanks for following me."
Ejemplo n.º 11
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "twitter")
     self._polling_interval = 0
     self._rate_limit_sleep = -1
     self._use_status = False
     self._use_direct_message = False
     self._auto_follow = False
     self._storage = None
     self._storage_location = None
     self._welcome_message = "Thanks for following me."
Ejemplo n.º 12
0
    def test_without_data(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        console:
        """, ConsoleConfiguration(), ".")

        bot_config = yaml.get_section("console")

        client_config = ClientConfigurationData("test")
        client_config.load_configuration(yaml, bot_config, ".")

        self.assertIsNone(client_config.license_keys)
Ejemplo n.º 13
0
    def test_with_data(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        console:
          bot:  bot
          prompt: ">>>"
          license_keys: $BOT_ROOT/config/license.keys
        """, ConsoleConfiguration(), ".")

        bot_config = yaml.get_section("console")

        client_config = ClientConfigurationData("test")
        client_config.load_configuration(yaml, bot_config, ".")

        self.assertEquals("./config/license.keys", client_config.license_keys)
Ejemplo n.º 14
0
    def test_without_data(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        console:
        """, ConsoleConfiguration(), ".")

        bot_config = yaml.get_section("console")

        client_config = ClientConfigurationData("test")
        client_config.load_configuration(yaml, bot_config, ".")

        self.assertIsNone(client_config.bot_selector)

        self.assertIsNotNone(client_config.scheduler)
        self.assertEqual(None, client_config.scheduler.name)
        self.assertEqual(0, client_config.scheduler.debug_level)
        self.assertFalse(client_config.scheduler.add_listeners)
        self.assertFalse(client_config.scheduler.remove_all_jobs)

        self.assertIsNone(client_config.renderer)
Ejemplo n.º 15
0
    def test_without_data(self):
        yaml = YamlConfigurationFile()
        self.assertIsNotNone(yaml)
        yaml.load_from_text("""
        console:
        """, ConsoleConfiguration(), ".")

        bot_config = yaml.get_section("console")

        client_config = ClientConfigurationData("test")
        client_config.load_configuration(yaml, bot_config, ".")

        self.assertIsNone(client_config.license_keys)

        self.assertIsNone(client_config.bot_selector)

        self.assertIsNotNone(client_config.scheduler)
        self.assertEquals(None, client_config.scheduler.name)
        self.assertEquals(0, client_config.scheduler.debug_level)
        self.assertFalse(client_config.scheduler.add_listeners)
        self.assertFalse(client_config.scheduler.remove_all_jobs)

        self.assertIsNone(client_config.renderer)
Ejemplo n.º 16
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "telegram")
     self._unknown_command = None
     self._unknown_command_srai = None
Ejemplo n.º 17
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "slack")
     self._polling_interval = 1
Ejemplo n.º 18
0
 def get_client_configuration(self):
     return ClientConfigurationData("events")
Ejemplo n.º 19
0
 def get_client_configuration(self):
     return ClientConfigurationData("polling")
Ejemplo n.º 20
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "console")
Ejemplo n.º 21
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "webwebsocket")
     self._host = "0.0.0.0"
     self._port = 80
Ejemplo n.º 22
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "console")
     self._default_userid = "console"
     self._prompt = ">>>"
Ejemplo n.º 23
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "telegram")
     self._unknown_command = None
     self._unknown_command_srai = None
Ejemplo n.º 24
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "console")
     self._default_userid = "console"
     self._prompt = ">>>"
Ejemplo n.º 25
0
 def __init__(self):
     ClientConfigurationData.__init__(self, "slack")
     self._polling_interval = 1