This commit is contained in:
Joscha 2018-07-26 14:36:58 +00:00
parent 3051b15095
commit 3eade77cf1
2 changed files with 2 additions and 46 deletions

View file

@ -1,13 +1,12 @@
import asyncio import asyncio
import logging import logging
logger = logging.getLogger(__name__)
from .connection import * from .connection import *
from .exceptions import * from .exceptions import *
from .utils import * from .utils import *
logger = logging.getLogger(__name__)
__all__ = ["Room", "Inhabitant"] __all__ = ["Room", "Inhabitant"]
@ -155,7 +154,6 @@ class Room:
async def _receive_packet(self, ptype, data, error, throttled): async def _receive_packet(self, ptype, data, error, throttled):
# Ignoring errors and throttling for now # Ignoring errors and throttling for now
logger.debug(f"Received packet of type: {ptype}")
functions = { functions = {
"bounce-event": self._event_bounce, "bounce-event": self._event_bounce,
#"disconnect-event": self._event_disconnect, # Not important, can ignore #"disconnect-event": self._event_disconnect, # Not important, can ignore

View file

@ -1,55 +1,13 @@
import asyncio import asyncio
#import logging
import time import time
#logger = logging.getLogger(__name__)
__all__ = [ __all__ = [
#"run_controller", "run_bot",
"mention", "mention_reduced", "similar", "mention", "mention_reduced", "similar",
"format_time", "format_time_delta", "format_time", "format_time_delta",
"Session", "Listing", "Session", "Listing", "Message",
"Message",
] ]
#def run_controller(controller, room):
# """
# Helper function to run a singular controller.
# """
#
# async def run():
# task, reason = await controller.connect(room)
# if task:
# await task
# else:
# logger.warn(f"Could not connect to &{room}: {reason!r}")
#
# asyncio.get_event_loop().run_until_complete(run())
#
#def run_bot(bot_class, room, *args, **kwargs):
# """
# Helper function to run a bot. To run Multibots, use the MultibotKeeper.
# This restarts the bot when it is explicitly restarted through Bot.restart().
# """
#
# async def run():
# while True:
# logger.info(f"Creating new instance and connecting to &{room}")
# bot = bot_class(*args, **kwargs)
# task, reason = await bot.connect(room)
# if task:
# await task
# else:
# logger.warn(f"Could not connect to &{room}: {reason!r}")
#
# if bot.restarting:
# logger.info(f"Restarting in &{room}")
# else:
# break
#
# asyncio.get_event_loop().run_until_complete(run())
def mention(nick): def mention(nick):
return "".join(c for c in nick if c not in ".!?;&<'\"" and not c.isspace()) return "".join(c for c in nick if c not in ".!?;&<'\"" and not c.isspace())