From e1d3e1150b26ee6db1c9bcc3e64c4c6752433ca8 Mon Sep 17 00:00:00 2001 From: "Vgr E. Barry" Date: Wed, 2 Nov 2016 16:14:23 -0400 Subject: [PATCH] Make IRCClient into a context manager For now just a placeholder, will properly do it later. --- oyoyo/client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/oyoyo/client.py b/oyoyo/client.py index 76aa0c5..32f50b7 100644 --- a/oyoyo/client.py +++ b/oyoyo/client.py @@ -108,6 +108,12 @@ class IRCClient: self.command_handler = cmd_handler self._end = 0 + def __enter__(self): + return self + + def __exit__(self, exc, value, tb): + return False # TODO: make this into a proper context manager + def send(self, *args, **kwargs): """ send a message to the connected server. all arguments are joined with a space for convenience, for example the following are identical