Beispiel #1
0
    def __init__(self):
        current_dir = os.path.dirname(os.path.abspath(__file__))
        static_dir = os.path.join(current_dir, '..', 'static')        
        log.info(current_dir)
        log.info(static_dir)


        self.config = { '/': {'tools.basic_auth.on': True,
               #               'tools.basic_auth.realm': 'CherryPy Restricted space. Hint[user:cherrypy & pass:cherrypy]',
                #              'tools.basic_auth.users': {'cherrypy':encrypt_pw('cherrypy')},
                 #             'tools.basic_auth.encrypt': encrypt_pw,
                              'tools.staticdir.root': static_dir},
                        '/static': {'tools.gzip.on': True,
                                    'tools.staticdir.on': True,
                                    'tools.staticdir.dir': ''},
                        '/static/css': {'tools.gzip.mime_types':['text/css'],
                                        'tools.staticdir.dir': 'css'},
                        '/static/js': {'tools.gzip.mime_types': ['application/javascript'],
                                       'tools.staticdir.dir': 'js'},
                        '/static/img': {'tools.staticdir.dir': 'images'}}

        self.rootServer = Receiver()        
Beispiel #2
0
                         "Try again in 5 seconds.")
        print "Connecting to server failed. Try again in 5 seconds."
        time.sleep(5)

    # when connected => generate watchdog object to monitor the
    # server connection
    watchdog = ConnectionWatchdog(globalData.serverComm,
                                  globalData.pingInterval,
                                  globalData.smtpAlert)
    # set thread to daemon
    # => threads terminates when main thread terminates
    watchdog.daemon = True
    watchdog.start()

    # generate receiver to handle incoming data (for example status updates)
    receiver = Receiver(globalData.serverComm)
    # set thread to daemon
    # => threads terminates when main thread terminates
    receiver.daemon = True
    receiver.start()

    # only start update checker if it is activated
    if updateActivated is True:
        updateChecker = UpdateChecker(updateServer, updatePort, updateLocation,
                                      updateCaFile, updateInterval,
                                      updateEmailNotification, globalData)
        # set thread to daemon
        # => threads terminates when main thread terminates
        updateChecker.daemon = True
        updateChecker.start()