mirror of
https://github.com/holub/mame
synced 2025-06-06 12:53:46 +03:00
minimaws: easier mod_wsgi deployment (nw)
This commit is contained in:
parent
cf1f9cc6bb
commit
9fbded3fa1
@ -589,6 +589,8 @@ class MiniMawsApp(object):
|
|||||||
|
|
||||||
def __call__(self, environ, start_response):
|
def __call__(self, environ, start_response):
|
||||||
application_uri = wsgiref.util.application_uri(environ)
|
application_uri = wsgiref.util.application_uri(environ)
|
||||||
|
if application_uri[-1] != '/':
|
||||||
|
application_uri += '/'
|
||||||
module = wsgiref.util.shift_path_info(environ)
|
module = wsgiref.util.shift_path_info(environ)
|
||||||
if module == 'machine':
|
if module == 'machine':
|
||||||
return MachineHandler(self, application_uri, environ, start_response)
|
return MachineHandler(self, application_uri, environ, start_response)
|
||||||
|
@ -78,13 +78,17 @@
|
|||||||
## and see dependent slots update. Required command-line arguments to
|
## and see dependent slots update. Required command-line arguments to
|
||||||
## produce the selected configuration are also displayed.
|
## produce the selected configuration are also displayed.
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import os.path
|
||||||
|
import sys
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
||||||
import lib.auxverbs
|
import lib.auxverbs
|
||||||
import lib.lxparse
|
import lib.lxparse
|
||||||
import lib.wsgiserve
|
import lib.wsgiserve
|
||||||
|
|
||||||
import argparse
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
@ -135,3 +139,5 @@ if __name__ == '__main__':
|
|||||||
lib.wsgiserve.run_server(options)
|
lib.wsgiserve.run_server(options)
|
||||||
elif options.command == 'load':
|
elif options.command == 'load':
|
||||||
lib.lxparse.load_info(options)
|
lib.lxparse.load_info(options)
|
||||||
|
else:
|
||||||
|
application = lib.wsgiserve.MiniMawsApp(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'minimaws.sqlite3'))
|
||||||
|
Loading…
Reference in New Issue
Block a user