From 399ce2519ab129e4b477bab036003bf9db8f7d44 Mon Sep 17 00:00:00 2001 From: PhilipTrauner Date: Mon, 2 Nov 2015 22:31:26 +0100 Subject: [PATCH] Initial api abstraction --- Shared/Abstraction.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Shared/Abstraction.py diff --git a/Shared/Abstraction.py b/Shared/Abstraction.py new file mode 100644 index 0000000..110e10e --- /dev/null +++ b/Shared/Abstraction.py @@ -0,0 +1,12 @@ +import socket +from ESock import ESock + +class fl0wAPI: + def __init__(self, address, client_type): + self.sock = socket.create_connection(address) + + self.authed = True + + def auth(self, user, password): + self.sock.send({"auth" : {"user" : user, "pw" : password}}) + if self.sock.recv() \ No newline at end of file