mirror of https://git.48k.eu/ogclient
src: log without backtrace in not implemented functions
Don't log a backtrace when a not implemented function is called in ogClient. Log a "Function not implemented" message.master
parent
71b3211d3d
commit
73ecb48113
|
@ -9,13 +9,14 @@
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from subprocess import CalledProcessError
|
from subprocess import CalledProcessError
|
||||||
|
from src.log import OgError
|
||||||
|
|
||||||
from src.ogRest import ThreadState
|
from src.ogRest import ThreadState
|
||||||
|
|
||||||
class OgLinuxOperations:
|
class OgLinuxOperations:
|
||||||
|
|
||||||
def _restartBrowser(self, url):
|
def _restartBrowser(self, url):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def poweroff(self):
|
def poweroff(self):
|
||||||
os.system('systemctl poweroff')
|
os.system('systemctl poweroff')
|
||||||
|
@ -41,25 +42,25 @@ class OgLinuxOperations:
|
||||||
return result.stdout
|
return result.stdout
|
||||||
|
|
||||||
def session(self, request, ogRest):
|
def session(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def hardware(self, path, ogRest):
|
def hardware(self, path, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def setup(self, request, ogRest):
|
def setup(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def image_restore(self, request, ogRest):
|
def image_restore(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def image_create(self, path, request, ogRest):
|
def image_create(self, path, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def cache_delete(self, request, ogRest):
|
def cache_delete(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def cache_fetch(self, request, ogRest):
|
def cache_fetch(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def refresh(self, ogRest):
|
def refresh(self, ogRest):
|
||||||
return {"status": "LINUX"}
|
return {"status": "LINUX"}
|
||||||
|
|
|
@ -467,10 +467,10 @@ class OgVirtualOperations:
|
||||||
return json_dict
|
return json_dict
|
||||||
|
|
||||||
def cache_delete(self, request, ogRest):
|
def cache_delete(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def cache_fetch(self, request, ogRest):
|
def cache_fetch(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def software(self, request, path, ogRest):
|
def software(self, request, path, ogRest):
|
||||||
DPKG_PATH = '/var/lib/dpkg/status'
|
DPKG_PATH = '/var/lib/dpkg/status'
|
||||||
|
|
|
@ -12,6 +12,7 @@ import subprocess
|
||||||
from subprocess import CalledProcessError
|
from subprocess import CalledProcessError
|
||||||
import multiprocessing as mp
|
import multiprocessing as mp
|
||||||
from multiprocessing import Process, freeze_support
|
from multiprocessing import Process, freeze_support
|
||||||
|
from src.log import OgError
|
||||||
|
|
||||||
from PIL import Image, ImageDraw
|
from PIL import Image, ImageDraw
|
||||||
from pystray import Icon, Menu, MenuItem
|
from pystray import Icon, Menu, MenuItem
|
||||||
|
@ -68,7 +69,7 @@ class OgWindowsOperations:
|
||||||
systray_p.start()
|
systray_p.start()
|
||||||
|
|
||||||
def _restartBrowser(self, url):
|
def _restartBrowser(self, url):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def poweroff(self):
|
def poweroff(self):
|
||||||
systray_p.terminate()
|
systray_p.terminate()
|
||||||
|
@ -96,25 +97,25 @@ class OgWindowsOperations:
|
||||||
return (result.returncode, cmd, result.stdout)
|
return (result.returncode, cmd, result.stdout)
|
||||||
|
|
||||||
def session(self, request, ogRest):
|
def session(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def hardware(self, path, ogRest):
|
def hardware(self, path, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def setup(self, request, ogRest):
|
def setup(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def image_restore(self, request, ogRest):
|
def image_restore(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def image_create(self, path, request, ogRest):
|
def image_create(self, path, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def cache_delete(self, request, ogRest):
|
def cache_delete(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def cache_fetch(self, request, ogRest):
|
def cache_fetch(self, request, ogRest):
|
||||||
raise NotImplementedError
|
raise OgError('Function not implemented')
|
||||||
|
|
||||||
def refresh(self, ogRest):
|
def refresh(self, ogRest):
|
||||||
return {"status": "WIN"}
|
return {"status": "WIN"}
|
||||||
|
|
Loading…
Reference in New Issue