mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
class Name(object): -> class Name:
This commit is contained in:
parent
4323027b1e
commit
422b18acea
@ -1,7 +1,7 @@
|
||||
import cherrypy
|
||||
|
||||
|
||||
class Root(object):
|
||||
class Root:
|
||||
@cherrypy.expose
|
||||
def index(self):
|
||||
return 'Hello World!'
|
||||
|
||||
@ -8,7 +8,7 @@ def child_process(queue):
|
||||
requests.get('http://requestb.in/15s95oz1')
|
||||
|
||||
|
||||
class GunicornSubProcessTestMiddleware(object):
|
||||
class GunicornSubProcessTestMiddleware:
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.queue = Queue()
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import sys
|
||||
import time
|
||||
|
||||
class TestIter(object):
|
||||
class TestIter:
|
||||
|
||||
def __iter__(self):
|
||||
lines = [b'line 1\n', b'line 2\n']
|
||||
|
||||
@ -24,7 +24,7 @@ from test import app as app1
|
||||
from test import app as app2
|
||||
|
||||
|
||||
class Application(object):
|
||||
class Application:
|
||||
def __init__(self):
|
||||
self.map = Mapper()
|
||||
self.map.connect('app1', '/app1url', app=app1)
|
||||
|
||||
@ -16,7 +16,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
WS_KEY = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
|
||||
|
||||
class WebSocketWSGI(object):
|
||||
class WebSocketWSGI:
|
||||
def __init__(self, handler):
|
||||
self.handler = handler
|
||||
|
||||
@ -117,7 +117,7 @@ class WebSocketWSGI(object):
|
||||
# doesn't barf on the fact that we didn't call start_response
|
||||
return ALREADY_HANDLED
|
||||
|
||||
class WebSocket(object):
|
||||
class WebSocket:
|
||||
"""A websocket object that handles the details of
|
||||
serialization/deserialization to the socket.
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
WS_KEY = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
|
||||
|
||||
class WebSocketWSGI(object):
|
||||
class WebSocketWSGI:
|
||||
def __init__(self, handler):
|
||||
self.handler = handler
|
||||
|
||||
@ -118,7 +118,7 @@ class WebSocketWSGI(object):
|
||||
# doesn't barf on the fact that we didn't call start_response
|
||||
return ALREADY_HANDLED
|
||||
|
||||
class WebSocket(object):
|
||||
class WebSocket:
|
||||
"""A websocket object that handles the details of
|
||||
serialization/deserialization to the socket.
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ from gunicorn.config import Config, get_default_config_file
|
||||
from gunicorn import debug
|
||||
|
||||
|
||||
class BaseApplication(object):
|
||||
class BaseApplication:
|
||||
"""
|
||||
An application interface for configuring and loading
|
||||
the various necessities for any given web framework.
|
||||
|
||||
@ -17,7 +17,7 @@ from gunicorn import sock, systemd, util
|
||||
from gunicorn import __version__, SERVER_SOFTWARE
|
||||
|
||||
|
||||
class Arbiter(object):
|
||||
class Arbiter:
|
||||
"""
|
||||
Arbiter maintain the workers processes alive. It launches or
|
||||
kills them if needed. It also manages application reloading
|
||||
|
||||
@ -42,7 +42,7 @@ def auto_int(_, x):
|
||||
return int(x, 0)
|
||||
|
||||
|
||||
class Config(object):
|
||||
class Config:
|
||||
|
||||
def __init__(self, usage=None, prog=None):
|
||||
self.settings = make_settings()
|
||||
@ -252,7 +252,7 @@ class SettingMeta(type):
|
||||
setattr(cls, "short", desc.splitlines()[0])
|
||||
|
||||
|
||||
class Setting(object):
|
||||
class Setting:
|
||||
name = None
|
||||
value = None
|
||||
section = None
|
||||
|
||||
@ -15,7 +15,7 @@ __all__ = ['spew', 'unspew']
|
||||
_token_spliter = re.compile(r'\W+')
|
||||
|
||||
|
||||
class Spew(object):
|
||||
class Spew:
|
||||
|
||||
def __init__(self, trace_names=None, show_values=True):
|
||||
self.trace_names = trace_names
|
||||
|
||||
@ -161,7 +161,7 @@ def parse_syslog_address(addr):
|
||||
return (socktype, (host, port))
|
||||
|
||||
|
||||
class Logger(object):
|
||||
class Logger:
|
||||
|
||||
LOG_LEVELS = {
|
||||
"critical": logging.CRITICAL,
|
||||
|
||||
@ -9,7 +9,7 @@ from gunicorn.http.errors import (NoMoreData, ChunkMissingTerminator,
|
||||
InvalidChunkSize)
|
||||
|
||||
|
||||
class ChunkedReader(object):
|
||||
class ChunkedReader:
|
||||
def __init__(self, req, unreader):
|
||||
self.req = req
|
||||
self.parser = self.parse_chunked(unreader)
|
||||
@ -107,7 +107,7 @@ class ChunkedReader(object):
|
||||
buf.write(data)
|
||||
|
||||
|
||||
class LengthReader(object):
|
||||
class LengthReader:
|
||||
def __init__(self, unreader, length):
|
||||
self.unreader = unreader
|
||||
self.length = length
|
||||
@ -137,7 +137,7 @@ class LengthReader(object):
|
||||
return ret
|
||||
|
||||
|
||||
class EOFReader(object):
|
||||
class EOFReader:
|
||||
def __init__(self, unreader):
|
||||
self.unreader = unreader
|
||||
self.buf = io.BytesIO()
|
||||
@ -175,7 +175,7 @@ class EOFReader(object):
|
||||
return ret
|
||||
|
||||
|
||||
class Body(object):
|
||||
class Body:
|
||||
def __init__(self, reader):
|
||||
self.reader = reader
|
||||
self.buf = io.BytesIO()
|
||||
|
||||
@ -29,7 +29,7 @@ METHOD_BADCHAR_RE = re.compile("[a-z#]")
|
||||
VERSION_RE = re.compile(r"HTTP/(\d)\.(\d)")
|
||||
|
||||
|
||||
class Message(object):
|
||||
class Message:
|
||||
def __init__(self, cfg, unreader, peer_addr):
|
||||
self.cfg = cfg
|
||||
self.unreader = unreader
|
||||
|
||||
@ -6,7 +6,7 @@ from gunicorn.http.message import Request
|
||||
from gunicorn.http.unreader import SocketUnreader, IterUnreader
|
||||
|
||||
|
||||
class Parser(object):
|
||||
class Parser:
|
||||
|
||||
mesg_class = None
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import os
|
||||
# a given type of data source.
|
||||
|
||||
|
||||
class Unreader(object):
|
||||
class Unreader:
|
||||
def __init__(self):
|
||||
self.buf = io.BytesIO()
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ HEADER_VALUE_RE = re.compile(r'[ \t\x21-\x7e\x80-\xff]*')
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FileWrapper(object):
|
||||
class FileWrapper:
|
||||
|
||||
def __init__(self, filelike, blksize=8192):
|
||||
self.filelike = filelike
|
||||
@ -197,7 +197,7 @@ def create(req, sock, client, server, cfg):
|
||||
return resp, environ
|
||||
|
||||
|
||||
class Response(object):
|
||||
class Response:
|
||||
|
||||
def __init__(self, req, sock, cfg):
|
||||
self.req = req
|
||||
|
||||
@ -7,7 +7,7 @@ import os
|
||||
import tempfile
|
||||
|
||||
|
||||
class Pidfile(object):
|
||||
class Pidfile:
|
||||
"""\
|
||||
Manage a PID file. If a specific name is provided
|
||||
it and '"%s.oldpid" % name' will be used. Otherwise
|
||||
|
||||
@ -116,7 +116,7 @@ if has_inotify:
|
||||
|
||||
else:
|
||||
|
||||
class InotifyReloader(object):
|
||||
class InotifyReloader:
|
||||
def __init__(self, extra_files=None, callback=None):
|
||||
raise ImportError('You must have the inotify module installed to '
|
||||
'use the inotify reloader')
|
||||
|
||||
@ -13,7 +13,7 @@ import time
|
||||
from gunicorn import util
|
||||
|
||||
|
||||
class BaseSocket(object):
|
||||
class BaseSocket:
|
||||
|
||||
def __init__(self, address, conf, log, fd=None):
|
||||
self.log = log
|
||||
|
||||
@ -25,7 +25,7 @@ from gunicorn.reloader import reloader_engines
|
||||
from gunicorn.workers.workertmp import WorkerTmp
|
||||
|
||||
|
||||
class Worker(object):
|
||||
class Worker:
|
||||
|
||||
SIGNALS = [getattr(signal, "SIG%s" % x) for x in (
|
||||
"ABRT HUP QUIT INT TERM USR1 USR2 WINCH CHLD".split()
|
||||
|
||||
@ -146,7 +146,7 @@ class GeventWorker(AsyncWorker):
|
||||
super().init_process()
|
||||
|
||||
|
||||
class GeventResponse(object):
|
||||
class GeventResponse:
|
||||
|
||||
status = None
|
||||
headers = None
|
||||
|
||||
@ -30,7 +30,7 @@ from .. import sock
|
||||
from ..http import wsgi
|
||||
|
||||
|
||||
class TConn(object):
|
||||
class TConn:
|
||||
|
||||
def __init__(self, cfg, sock, client, server):
|
||||
self.cfg = cfg
|
||||
|
||||
@ -13,7 +13,7 @@ PLATFORM = platform.system()
|
||||
IS_CYGWIN = PLATFORM.startswith('CYGWIN')
|
||||
|
||||
|
||||
class WorkerTmp(object):
|
||||
class WorkerTmp:
|
||||
|
||||
def __init__(self, cfg):
|
||||
old_umask = os.umask(cfg.umask)
|
||||
|
||||
@ -21,7 +21,7 @@ def data_source(fname):
|
||||
return buf
|
||||
|
||||
|
||||
class request(object):
|
||||
class request:
|
||||
def __init__(self, name):
|
||||
self.fname = os.path.join(dirname, "requests", name)
|
||||
|
||||
@ -33,7 +33,7 @@ class request(object):
|
||||
return run
|
||||
|
||||
|
||||
class FakeSocket(object):
|
||||
class FakeSocket:
|
||||
|
||||
def __init__(self, data):
|
||||
self.tmp = tempfile.TemporaryFile()
|
||||
|
||||
@ -31,7 +31,7 @@ def paster_ini():
|
||||
return os.path.join(dirname, "..", "examples", "frameworks", "pylonstest", "nose.ini")
|
||||
|
||||
|
||||
class AltArgs(object):
|
||||
class AltArgs:
|
||||
def __init__(self, args=None):
|
||||
self.args = args or []
|
||||
self.orig = sys.argv
|
||||
@ -97,7 +97,7 @@ def test_property_access():
|
||||
# Not a config property
|
||||
pytest.raises(AttributeError, getattr, c, "foo")
|
||||
# Force to be not an error
|
||||
class Baz(object):
|
||||
class Baz:
|
||||
def get(self):
|
||||
return 3.14
|
||||
c.settings["foo"] = Baz()
|
||||
|
||||
@ -15,7 +15,7 @@ class StatsdTestException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class MockSocket(object):
|
||||
class MockSocket:
|
||||
"Pretend to be a UDP socket"
|
||||
def __init__(self, failp):
|
||||
self.failp = failp
|
||||
|
||||
@ -39,7 +39,7 @@ def load_py(fname):
|
||||
return vars(mod)
|
||||
|
||||
|
||||
class request(object):
|
||||
class request:
|
||||
def __init__(self, fname, expect):
|
||||
self.fname = fname
|
||||
self.name = os.path.basename(fname)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user