Skip to content

Commit

Permalink
remove spawning stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
nferrier committed Aug 22, 2010
1 parent 18f552b commit 911e78d
Showing 1 changed file with 4 additions and 29 deletions.
33 changes: 4 additions & 29 deletions ms.py
Expand Up @@ -2,16 +2,17 @@
""" """
MultiServer MultiServer
This is a simple wsgi handler for Spawning that does virtual host This is a simple wsgi server that does virtual host handling across a
handling across a directory of python modules. directory of python modules.
This can use a config variable wsgi_path to find the modules. The path This can use a config variable wsgi_path to find the modules. The path
can be specified in a config file: ~/.mswsgi.conf can be specified in a config file: ~/.mswsgi.conf
[Server] [Server]
wsgi_path = ... wsgi_path = ...
The python module loaded is right now, always: server.spawnwoome The python module loaded is always a woome repo right now. Will work
out a way to specify a config.
""" """


import re import re
Expand Down Expand Up @@ -90,32 +91,6 @@ def wsgi_dispatcher(environ, start_response):
from ConfigParser import ConfigParser from ConfigParser import ConfigParser
from os.path import expanduser from os.path import expanduser


### Spawning stuff
### Start this under spawning like:
### spawn -p 8110 -f ms.spawning_config_factory none

def app_factory(conf):
return multiwsgidispatch(conf.get("wsgi_path"))

def spawning_config_factory(args):
"""A Spawning config factory"""
conf = ConfigParser()
try:
conf.read(expanduser("~/.mswsgi.conf"))
except:
pass

return {
'args': args,
'host': args.get('host'),
'port': args.get('port'),
'app_factory': "ms.app_factory",
'app': "",
'wsgi_path': conf.get("Server", "wsgi_path"),
'deadman_timeout': 10,
'num_processes': 4,
}

import wsgiref.simple_server import wsgiref.simple_server
RealServerHandler = wsgiref.simple_server.ServerHandler RealServerHandler = wsgiref.simple_server.ServerHandler
class MServerHandler(RealServerHandler): class MServerHandler(RealServerHandler):
Expand Down

0 comments on commit 911e78d

Please sign in to comment.