From: Jonatan Schlag Date: Sat, 21 Apr 2018 11:01:07 +0000 (+0200) Subject: Add new function line_in_buffer X-Git-Url: http://git.ipfire.org/?p=nitsi.git;a=commitdiff_plain;h=e54f9c23e2579d8142c06e1b054df01e550d31fe Add new function line_in_buffer This functions check if we can read line out of our buffer. Signed-off-by: Jonatan Schlag --- diff --git a/test.py b/test.py index 9df1bd1..53f0052 100755 --- a/test.py +++ b/test.py @@ -233,6 +233,11 @@ class connection(): return self.con.in_waiting + def line_in_buffer(self): + if b"\n" in self.buffer: + return True + + return False def readline2(self, pattern=None): string = ""