moved some frontends/* to new backends/; backends are threads running in background, no frontend

This commit is contained in:
Johannes Findeisen 2013-10-01 06:17:08 +02:00
commit c0ddae7eb5
4 changed files with 16 additions and 9 deletions

View file

@ -1,13 +1,13 @@
"""
A HTTPS frontend to the current Linspector instance.
A HTTPS backend to the current Linspector instance.
A Webserver listening for requests to give information about the internal state of linspector.
(maybe providing a JSON API to the instance too...)
"""
from lib.frontends.frontend import Frontend
from lib.backends.backend import Backend
class HttpsFrontend(Frontend):
class HttpsBackend(Backend):
def __init__(self, **kwargs):
return

View file

@ -5,9 +5,9 @@ Just for the fun in it... Linspector connects to a XMPP Server and are accepting
give back information. The Linspector admin client will then be any Jabber Client... ;)
"""
from lib.frontends.frontend import Frontend
from lib.backends.backend import Backend
class XmmpFrontend(Frontend):
class XmmpBackend(Backend):
def __init__(self, **kwargs):
pass

View file

@ -1,9 +1,8 @@
"""
Just the frontends.py stub... ;)
Frontends are GUI interfaces to Linspector. This could be a shell or other terminal based GUI.
If linspector is being started without a frontend "enabled" it just is doing stuff like: polling, alerting, logging etc.
Frontends are absolutely no requirement for running Linspector.
Frontends are absolutely no requirement for running Linspector. If no frontend is selected Linspector will just log
stuff to stdout.
"""

View file

@ -11,6 +11,7 @@ import os.path as path
from apscheduler.scheduler import Scheduler
from lib.config.parser import FullConfigParser
from lib.core.job import Job
from lib.backends.https import HttpsBackend
from lib.frontends.lish import LishFrontend
@ -98,6 +99,13 @@ def main():
job.set_logger(log)
jobs.append(job)
#TODO: Load Backend Threads here before initializing the frontend.
'''
for backend in backends.enabled
backend.start
take care of signals etc. to sthutdown the threads when stopping linspector.
'''
frontend = LishFrontend(jobs=jobs, scheduler=scheduler, linspectorConfig=linConf)
log.debug("shutting down scheduler")