while we are here just parse all the address in the conf file. so we

could have unix socket support in paster app too by just passing the
host
This commit is contained in:
Benoit Chesneau 2010-02-15 14:41:13 +01:00
parent 7036e424bb
commit d00712da2e
3 changed files with 5 additions and 8 deletions

View File

@ -112,10 +112,7 @@ def main(usage, get_app):
workers = 1
bind = opts.bind or '127.0.0.1'
if bind.startswith("unix:"):
addr = bind.split("unix:")[1]
else:
addr = util.parse_address(bind)
addr = util.parse_address(bind)
umask = int(opts.umask or UMASK)

View File

@ -47,10 +47,7 @@ class Command(BaseCommand):
raise CommandError('Usage is runserver %s' % self.args)
bind = addrport or '127.0.0.1'
if bind.startswith("unix:"):
addr = bind.split("unix:")[1]
else:
addr = parse_address(bind)
addr = parse_address(bind)
admin_media_path = options.get('admin_media_path', '')
workers = int(options.get('workers', '1'))

View File

@ -31,6 +31,9 @@ monthname = [None,
def parse_address(host, port=None, default_port=8000):
if host.startswith("unix:"):
return host.split("unix:")[1]
if not port:
if ':' in host:
host, port = host.split(':', 1)