summaryrefslogtreecommitdiff
path: root/DeviceAuth.py
diff options
context:
space:
mode:
authorDmitrii Morozov <snoopdesigns@gmail.com>2024-04-08 23:40:24 +0200
committerDmitrii Morozov <snoopdesigns@gmail.com>2024-04-08 23:40:24 +0200
commit7b992afe70925f244ca6e9746071ae71e497b54e (patch)
tree8c3b0184f5060c8e3adc632f27ff694a1b22c0e2 /DeviceAuth.py
parent733e7e23a14588358607a65c2bb1f2677c1e53c6 (diff)
Observe status of friends
Diffstat (limited to 'DeviceAuth.py')
-rw-r--r--DeviceAuth.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/DeviceAuth.py b/DeviceAuth.py
new file mode 100644
index 0000000..d62731c
--- /dev/null
+++ b/DeviceAuth.py
@@ -0,0 +1,26 @@
+import json
+import os
+
+class DeviceAuth:
+
+ __filename__ = 'device-auth.json'
+
+ def __init__(self):
+ print('DeviceAuth init')
+
+
+ def device_auth_file_exists(self):
+ return os.path.isfile(self.__filename__)
+
+ def get_device_auth_details(self):
+ if os.path.isfile(self.__filename__):
+ with open(self.__filename__, 'r') as fp:
+ return json.load(fp)
+ return {}
+
+ def store_device_auth_details(self, email, details):
+ existing = self.get_device_auth_details()
+ existing[email] = details
+
+ with open(self.__filename__, 'w') as fp:
+ json.dump(existing, fp) \ No newline at end of file