Ejemplo n.º 1
0
 def __init__(self, config=None):
     """Start opsdroid."""
     self.bot_name = "opsdroid"
     self._running = False
     self.sys_status = 0
     self.connectors = []
     self.connector_tasks = []
     self.eventloop = asyncio.get_event_loop()
     if os.name != "nt":
         for sig in (signal.SIGINT, signal.SIGTERM):
             self.eventloop.add_signal_handler(
                 sig, lambda: asyncio.ensure_future(self.handle_signal()))
     self.eventloop.set_exception_handler(self.handle_async_exception)
     self.skills = []
     self.memory = Memory()
     self.modules = {}
     self.cron_task = None
     self.loader = Loader(self)
     if config is None:
         self.config = {}
     else:
         self.config = config
     self.stats = {
         "messages_parsed": 0,
         "webhooks_called": 0,
         "total_response_time": 0,
         "total_responses": 0,
     }
     self.web_server = None
     self.stored_path = []
Ejemplo n.º 2
0
 def __init__(self):
     """Start opsdroid."""
     self.bot_name = 'opsdroid'
     self.sys_status = 0
     self.connectors = []
     self.connector_tasks = []
     self.eventloop = asyncio.get_event_loop()
     for sig in (signal.SIGINT, signal.SIGTERM):
         self.eventloop.add_signal_handler(sig, self.call_stop)
     self.skills = []
     self.memory = Memory()
     self.loader = Loader(self)
     self.config = {}
     self.stats = {
         "messages_parsed": 0,
         "webhooks_called": 0,
         "total_response_time": 0,
         "total_responses": 0,
     }
     self.web_server = None
     self.should_restart = False
     self.stored_path = []
Ejemplo n.º 3
0
 def setup(self):
     mem = Memory()
     mem.databases = [InMemoryDatabase()]
     return mem
Ejemplo n.º 4
0
 def setup(self):
     return Memory()
Ejemplo n.º 5
0
def memory():
    mem = Memory()
    mem.databases = [InMemoryDatabase()]
    return mem