From 19ff507ba9b2490484191f22b69ba3ea250fc9e8 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Mon, 6 Jan 2014 03:52:53 +0100 Subject: [PATCH] python: Cleaned up a few uglies. --- python3/ashd-wsgi3 | 6 +++--- python3/ashd/serve.py | 2 +- python3/scgi-wsgi3 | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python3/ashd-wsgi3 b/python3/ashd-wsgi3 index 2a8815b..de6c20e 100755 --- a/python3/ashd-wsgi3 +++ b/python3/ashd-wsgi3 @@ -1,7 +1,7 @@ #!/usr/bin/python3 -import sys, os, getopt, threading, socket, logging, time, locale, collections -import ashd.proto, ashd.util, ashd.perf, ashd.serve +import sys, os, getopt, socket, logging, time, locale, collections +import ashd.util, ashd.serve try: import pdm.srv except: @@ -25,7 +25,7 @@ for o, a in opts: elif o == "-A": modwsgi_compat = True elif o == "-l": - hspec = "free", {"max": int(a), "abort": 10} + hspec = "free", {"max": a, "abort": "10"} elif o == "-t": hspec = ashd.serve.parsehspec(a) elif o == "-m": diff --git a/python3/ashd/serve.py b/python3/ashd/serve.py index f116518..ebee436 100644 --- a/python3/ashd/serve.py +++ b/python3/ashd/serve.py @@ -23,7 +23,7 @@ class reqthread(threading.Thread): super().__init__(name=name, **kw) class wsgirequest(object): - def __init__(self, handler): + def __init__(self, *, handler): self.status = None self.headers = [] self.respsent = False diff --git a/python3/scgi-wsgi3 b/python3/scgi-wsgi3 index b2ec1ca..a8fccf0 100755 --- a/python3/scgi-wsgi3 +++ b/python3/scgi-wsgi3 @@ -2,7 +2,7 @@ import sys, os, getopt, logging, collections import socket -import ashd.scgi, ashd.perf, ashd.serve +import ashd.scgi, ashd.serve try: import pdm.srv except: @@ -132,13 +132,13 @@ class request(ashd.serve.wsgirequest): self.bsk.close() if hspec[0] not in ashd.serve.names: - sys.stderr.write("ashd-wsgi3: no such request handler: %s\n" % hspec[0]) + sys.stderr.write("scgi-wsgi3: no such request handler: %s\n" % hspec[0]) sys.exit(1) hclass = ashd.serve.names[hspec[0]] try: hargs = hclass.parseargs(**hspec[1]) except ValueError as exc: - sys.stderr.write("ashd-wsgi3: %s\n" % exc) + sys.stderr.write("scgi-wsgi3: %s\n" % exc) sys.exit(1) reqhandler = hclass(**hargs) -- 2.11.0