Exemplo n.º 1
0
def signal_handler():
    """
    the signal handler to shut down freevo
    """
    logger.debug('signal_handler()')
    logger.debug('shutdown() called')
    shutdown(exit=True)
    logger.debug('SystemExit raised')
    raise SystemExit
Exemplo n.º 2
0
def unix_signal_handler(sig, frame):
    """
    Unix signal handler to shut down freevo
    """
    logger.debug('unix_signal_handler(sig=%r, frame=%r)', sig, frame)
    logger.debug('shutdown() called')
    shutdown(exit=True)
    logger.debug('SystemExit raised')
    raise SystemExit
Exemplo n.º 3
0
def signal_handler():
    """
    the signal handler to shut down freevo
    """
    logger.debug('signal_handler()')
    logger.debug('shutdown() called')
    shutdown(exit=True)
    logger.debug('SystemExit raised')
    raise SystemExit
Exemplo n.º 4
0
def unix_signal_handler(sig, frame):
    """
    Unix signal handler to shut down freevo
    """
    logger.debug('unix_signal_handler(sig=%r, frame=%r)', sig, frame)
    logger.debug('shutdown() called')
    shutdown(exit=True)
    logger.debug('SystemExit raised')
    raise SystemExit
Exemplo n.º 5
0
def signal_handler():
    """
    the signal handler to shut down freevo
    """
    _debug_('signal_handler()', 2)
    global _shutting_down
    if _shutting_down:
        return
    _shutting_down = True
    shutdown(exit=True)
Exemplo n.º 6
0
def shutdown_action(action=None):
    """
    schedules a wakeup and shuts down

    @param action: (type Shutdown)
    """
    logger.debug('shutdown_action(action=%r)', action)
    if (action == Shutdown.SHUTDOWN_WAKEUP):
        action = __schedule_wakeup_and_shutdown()

    if config.AUTOSHUTDOWN_PRETEND:
        action = Shutdown.IGNORE

    if (action == Shutdown.RESTART_SYSTEM):
        shutdown(menuw=None, mode=ShutdownModes.SYSTEM_RESTART)
    elif (action == Shutdown.SHUTDOWN_SYSTEM):
        shutdown(menuw=None, mode=ShutdownModes.SYSTEM_SHUTDOWN)
    elif (action == Shutdown.SHUTDOWN_FREEVO):
        shutdown(menuw=None, mode=ShutdownModes.FREEVO_SHUTDOWN)
    elif (action == Shutdown.IGNORE):
        pass
    else:
        raise ExInternalError
    return
Exemplo n.º 7
0
def shutdown_action(action=None):
    """
    schedules a wakeup and shuts down

    @param action: (type Shutdown)
    """
    logger.debug('shutdown_action(action=%r)', action)
    if (action == Shutdown.SHUTDOWN_WAKEUP):
        action = __schedule_wakeup_and_shutdown()

    if config.AUTOSHUTDOWN_PRETEND:
        action = Shutdown.IGNORE

    if (action == Shutdown.RESTART_SYSTEM):
        shutdown(menuw=None, mode=ShutdownModes.SYSTEM_RESTART)
    elif (action == Shutdown.SHUTDOWN_SYSTEM):
        shutdown(menuw=None, mode=ShutdownModes.SYSTEM_SHUTDOWN)
    elif (action == Shutdown.SHUTDOWN_FREEVO):
        shutdown(menuw=None, mode=ShutdownModes.FREEVO_SHUTDOWN)
    elif (action == Shutdown.IGNORE):
        pass
    else:
        raise ExInternalError
    return
Exemplo n.º 8
0
                try:
                    pydoc.writedoc(file[4:-3])
                except:
                    pass
        try:
            os.mkdir('Docs/api')
        except:
            pass
        for file in util.match_files('.', [
                'html',
        ]):
            print 'moving %s' % file
            os.rename(file, 'Docs/api/%s' % file)
        print
        print 'wrote api doc to \'Docs/api\''
        shutdown(exit=True)

try:
    # signal handler
    signal.signal(signal.SIGTERM, unix_signal_handler)
    signal.signal(signal.SIGINT, unix_signal_handler)
    kaa.main.signals['shutdown'].connect(signal_handler)

    # load the fxditem to make sure it's the first in the
    # mimetypes list
    import fxditem

    # load all plugins
    import plugin

    # prepare the skin
Exemplo n.º 9
0
def signal_handler(sig, frame):
    """
    the signal handler to shut down freevo
    """
    if sig in (signal.SIGTERM, signal.SIGINT):
        shutdown(exit=True)
Exemplo n.º 10
0
               file.find('src/www') == -1 and file.find('src/helpers') == -1:
            file = re.sub('/', '.', file)
            try:
                pydoc.writedoc(file[4:-3])
            except:
                pass
    try:
        os.mkdir('Docs/api')
    except:
        pass
    for file in util.match_files('.', ['html', ]):
        print 'moving %s' % file
        os.rename(file, 'Docs/api/%s' % file)
    print
    print 'wrote api doc to \'Docs/api\''
    shutdown(exit=True)


try:
    # signal handler
    signal.signal(signal.SIGTERM, unix_signal_handler)
    signal.signal(signal.SIGINT, unix_signal_handler)
    kaa.main.signals['shutdown'].connect(signal_handler)
    kaa.main.signals['exception'].connect(exception_handler)

    # load the fxditem to make sure it's the first in the
    # mimetypes list
    import fxditem

    # load all plugins
    import plugin