Example #1
0
File: XDM.py Project: parksnico/XDM
def main():
    app = App()
    if not app.options.noWebServer:
        try:
            app.startWebServer()
        except IOError:
            log.error("Unable to start web server, is something else running on port %d?" % app.port)
            os._exit(1)
    else:
        log.info('Not starting webserver because of the command line option --noWebServer')
    if (not app.options.noApi) and common.SYSTEM.c.api_active:
        try:
            api = JSONRPCapi(app.port_api)
        except:
            log.error('could not init jsonrpc api')
            os._exit(1)
        else:
            log('Starting api thread')
            api.start()
    else:
        log.info('Api is OFF')

    common.addState(2)
    common.removeState(0)

    common.SM.setNewMessage("Up and running.")
    common.SM.setNewMessage("Done!")

    try:
        while True:
            time.sleep(1)

    except KeyboardInterrupt:
        actionManager.executeAction('shutdown', 'KeyboardInterrupt')
    os._exit()
Example #2
0
def removeTempElements():
    common.addState(6)
    for temp in list(Element.select().where(Element.status == common.TEMP)):
        temp.delete_instance(silent=True)

    log.info("Removeing temp elements DONE")
    common.removeState(6)
Example #3
0
def removeTempElements():
    common.addState(6)
    for temp in list(Element.select().where(Element.status == common.TEMP)):
        temp.delete_instance(silent=True)

    log.info("Removeing temp elements DONE")
    common.removeState(6)
Example #4
0
File: tasks.py Project: DINKIN/XDM
def removeTempElements():
    common.addState(6)
    silent = not common.STARTOPTIONS.dev
    for temp in list(Element.select().where(Element.status == common.TEMP)):
        temp.delete_instance(silent=silent)

    log.info("Removeing temp elements DONE")
    common.removeState(6)
Example #5
0
def removeTempElements():
    common.addState(6)
    silent = not common.STARTOPTIONS.dev
    for temp in list(Element.select().where(Element.status == common.TEMP)):
        temp.delete_instance(silent=silent)

    log.info("Removeing temp elements DONE")
    common.removeState(6)
Example #6
0
def soFreshAndSoClean():
    """Runs every available clean function
    the garbage collector scheduler will call this
    """
    common.addState(6)

    cleanTemporaryElements()
    deleteOrphanFields()

    # add more functions here
    common.removeState(6)
Example #7
0
def soFreshAndSoClean():
    """Runs every available clean function
    the garbage collector scheduler will call this
    """
    common.addState(6)
    try:
        # add more functions here
        cleanTemporaryElements()
        deleteOrphanFields()
        deleteOrphanImages()
        fixImages()
    except:
        raise
    finally:
        common.removeState(6)
Example #8
0
def soFreshAndSoClean():
    """Runs every available clean function
    the garbage collector scheduler will call this
    """
    common.addState(6)
    try:
        # add more functions here
        cleanTemporaryElements()
        deleteOrphanFields()
        deleteOrphanImages()
        fixImages()
        deleteOrphanElements()
    except:
        raise
    finally:
        common.removeState(6)
Example #9
0
def main():
    try:
        signal.signal(signal.SIGTERM, shutdown_handler)
        signal.signal(signal.SIGHUP, reboot_handler)
    except AttributeError:
        log.debug("Could not connect signal handler")

    app = App()
    if not app.options.noWebServer:
        try:
            app.startWebServer()
        except IOError:
            log.error(
                "Unable to start web server, is something else running on port %d?"
                % app.port)
            os._exit(1)
    else:
        log.info(
            'Not starting webserver because of the command line option --noWebServer'
        )
    if (not app.options.noApi) and common.SYSTEM.c.api_active:
        try:
            api = JSONRPCapi(app.port_api)
        except:
            log.error('could not init jsonrpc api')
            os._exit(1)
        else:
            log('Starting api thread')
            api.start()
    else:
        log.info('Api is OFF')

    common.addState(2)
    common.removeState(0)

    common.SM.setNewMessage("Up and running.")
    common.SM.setNewMessage("Done!")

    try:
        while True:
            time.sleep(1)

    except KeyboardInterrupt:
        actionManager.executeAction('shutdown', 'KeyboardInterrupt')
    os._exit()
Example #10
0
File: XDM.py Project: Trixter69/XDM
def main():
    try:
        signal.signal(signal.SIGTERM, shutdown_handler)
        signal.signal(signal.SIGHUP, reboot_handler)
    except AttributeError:
        log.debug("Could not connect signal handler")

    app = App()
    if not app.options.noWebServer:
        try:
            app.startWebServer()
        except IOError:
            log.error("Unable to start web server, is something else running on port %d?" % app.port)
            os._exit(1)
    else:
        log.info("Not starting webserver because of the command line option --noWebServer")
    if (not app.options.noApi) and common.SYSTEM.c.api_active:
        try:
            api = JSONRPCapi(app.port_api)
        except:
            log.error("could not init jsonrpc api")
            os._exit(1)
        else:
            log("Starting api thread")
            api.start()
    else:
        log.info("Api is OFF")

    common.addState(2)
    common.removeState(0)

    common.SM.setNewMessage("Up and running.")
    common.SM.setNewMessage("Done!")

    try:
        while True:
            time.sleep(1)

    except KeyboardInterrupt:
        actionManager.executeAction("shutdown", "KeyboardInterrupt")
    os._exit()
Example #11
0
xdm_config_data_path = ""

xdm_args = ["-n"]
if xdm_config_data_path:
    xdm_args.extend(["-b", xdm_config_data_path])

print "Booting XDM"
import XDM
app = XDM.App(xdm_args)
app.startWebServer()

from xdm import common
from xdm import actionManager

print "Booting XDM done"
common.addState(2)
common.removeState(0)


class Page(object):
    basic_url = "http://localhost:8085/"

    def __init__(self, name, url, height=0, width=1440, delay=500, js=""):
        self.name = name
        self._url = url
        self.height = height
        self.width = width
        self.delay = delay
        self.js = js

    @property
Example #12
0
xdm_config_data_path = ""

xdm_args = ["-n"]
if xdm_config_data_path:
    xdm_args.extend(["-b", xdm_config_data_path])

print "Booting XDM"
import XDM
app = XDM.App(xdm_args)
app.startWebServer()

from xdm import common
from xdm import actionManager

print "Booting XDM done"
common.addState(2)
common.removeState(0)


class Page(object):
    basic_url = "http://localhost:8085/"

    def __init__(self, name, url, height=0, width=1440, delay=500, js=""):
        self.name = name
        self._url = url
        self.height = height
        self.width = width
        self.delay = delay
        self.js = js
    
    @property