Add new function line_in_buffer
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Sat, 21 Apr 2018 11:01:07 +0000 (13:01 +0200)
committerJonatan Schlag <jonatan.schlag@ipfire.org>
Sat, 21 Apr 2018 11:01:07 +0000 (13:01 +0200)
This functions check if we can read line out of our buffer.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
test.py

diff --git a/test.py b/test.py
index 9df1bd1..53f0052 100755 (executable)
--- 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 = ""