Advertisement
Guest User

server

a guest
Oct 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1. # coding:utf-8
  2.  
  3. import os.path
  4. import cherrypy
  5. import sys
  6.  
  7. from app import application
  8.  
  9. #----------------------------------------------------------
  10. def main():
  11. #----------------------------------------------------------
  12.    
  13.    # aktuelles Verzeichnis ermitteln, damit es in der Konfigurationsdatei als
  14.    # Bezugspunkt verwendet werden kann  
  15.    try:                                    # aktuelles Verzeichnis als absoluter Pfad
  16.       currentDir_s = os.path.dirname(os.path.abspath(__file__))
  17.    except:
  18.       currentDir_s = os.path.dirname(os.path.abspath(sys.executable))
  19.    cherrypy.Application.currentDir_s = currentDir_s
  20.  
  21.    configFileName_s = 'server.conf' # im aktuellen Verzeichnis  
  22.    if os.path.exists(configFileName_s) == False:
  23.       # Datei gibt es nicht
  24.       configFileName_s = None
  25.    
  26.    # autoreload und timeout_Monitor hier abschalten
  27.    # für cherrypy-Versionen >= "3.1.0" !
  28.    cherrypy.engine.autoreload.unsubscribe()
  29.    
  30.    cherrypy.quickstart(application.Application_cl(), config=configFileName_s)  
  31.    
  32. #----------------------------------------------------------
  33. if __name__ == '__main__':
  34. #----------------------------------------------------------
  35.    main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement