# -*- coding: utf-8 -*- """ This file is covered by the LICENSING file in the root of this project. """ #!flask/bin/python from client import app if __name__ == "__main__": app.run(host='0.0.0.0', port=80)
from client import app if __name__ == "__main__": app.run(port=5000, debug=True)
# -*- coding: utf-8 -*- """ This file is covered by the LICENSING file in the root of this project. """ #!flask/bin/python from client import app if __name__ == "__main__": app.run(host='0.0.0.0', port=80, debug=True)
from os.path import join, dirname from client import app def fread(fn): with open(join(dirname(__file__), fn), 'r') as f: return f.read().decode("utf-8") app.config["OAUTH_CREDENTIALS"] = { u"rsa_key": fread("mykey.pem"), u"signature_method": u"RSA-SHA1", "signature_type": "body" } app.config["CLIENT_KEY"] = u"5kCCg9t3amq636IsP6PcDGwdJhgdRG" app.run(debug=True, port=5001)
# ----------------------------------------------------------------------------------- # Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # ----------------------------------------------------------------------------------- #!flask/bin/python from client import app if __name__ == "__main__": app.run(host='0.0.0.0', port=80, debug=True)
import socket class AppServerSvc(win32serviceutil.ServiceFramework): _svc_name_ = "TestService" _svc_display_name_ = "Test Service" def __init__(self, args): win32serviceutil.ServiceFramework.__init__(self, args) self.hWaitStop = win32event.CreateEvent(None, 0, 0, None) socket.setdefaulttimeout(60) def SvcStop(self): self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) win32event.SetEvent(self.hWaitStop) def SvcDoRun(self): servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE, servicemanager.PYS_SERVICE_STARTED, (self._svc_name_, '')) self.main() def main(self): pass if __name__ == '__main__': print(app) app.run(host="127.0.0.1", port=5050) win32serviceutil.HandleCommandLine(AppServerSvc)
from client import app if __name__ == '__main__': app.run()