summaryrefslogtreecommitdiffstats
path: root/src/ogProcess.py
diff options
context:
space:
mode:
authorAlvaro Neira Ayuso <aneira@soleta.eu>2019-12-12 15:53:38 +0100
committerAlvaro Neira Ayuso <alvaroneay@gmail.com>2020-01-19 19:50:44 +0100
commitebd640a9c5d308c0ba115fea6c8cc0666010eab6 (patch)
tree62cd0994d373005755df84fa4f539d870cef8fad /src/ogProcess.py
parentbfdeae840c95fb9da504af795179be65c6286326 (diff)
Add ogProcess and ogOperation for linux
Thoses new classes allows us to process and execute commands from server side sent using HTTP format.
Diffstat (limited to 'src/ogProcess.py')
-rw-r--r--src/ogProcess.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ogProcess.py b/src/ogProcess.py
new file mode 100644
index 0000000..35abb89
--- /dev/null
+++ b/src/ogProcess.py
@@ -0,0 +1,20 @@
+import threading
+import platform
+import time
+
+print(platform.system())
+
+if platform.system() == 'Linux':
+ from linux import ogOperations
+
+class ogProcess():
+ def processOperation(self, op, URI):
+ if ("poweroff" in URI):
+ self.process_poweroff()
+
+ def process_poweroff(self):
+ # Powering off thread
+ def pwoff():
+ time.sleep(2)
+ ogOperations.poweroff()
+ threading.Thread(target=pwoff).start()