def main():
    ' '
    if (CURRENT_PYTHON_VERSION <= PYTHON_26):
        print('Python 2.5 and older is not supported anymore. Please use Python 2.6 or newer.')
        return 3
    action = None
    if (len(sys.argv) > 1):
        action = sys.argv[1]
    if ((sys.platform == 'win32') and (action != 'foreground')):
        win32serviceutil.HandleCommandLine(WindowsService)
        return 0
    if action:
        daemon = LinuxDaemon()
        func = getattr(daemon, action, None)
        if ((action[:1] != '_') and (func is not None)):
            func()
            return 0
        print(('Unknown command: %s' % action))
    print(('usage: %s start|stop|restart|foreground' % sys.argv[0]))
    return 2
def main():
    ' '
    if (CURRENT_PYTHON_VERSION <= PYTHON_26):
        print('Python 2.5 and older is not supported anymore. Please use Python 2.6 or newer.')
        return 3
    action = None
    if (len(sys.argv) > 1):
        action = sys.argv[1]
    if ((sys.platform == 'win32') and (action != 'foreground')):
        win32serviceutil.HandleCommandLine(WindowsService)
        return 0
    if action:
        daemon = LinuxDaemon()
        func = getattr(daemon, action, None)
        if ((action[:1] != '_') and (func is not None)):
            func()
            return 0
        print(('Unknown command: %s' % action))
    print(('usage: %s start|stop|restart|foreground' % sys.argv[0]))
    return 2