mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix erros spotted by pyflakes
This commit is contained in:
parent
57d6f1b507
commit
5b2f98fca4
@ -52,7 +52,7 @@ Usage
|
|||||||
unix:/tmp/gunicorn.sock
|
unix:/tmp/gunicorn.sock
|
||||||
-k WORKERCLASS, --worker-class=WORKERCLASS
|
-k WORKERCLASS, --worker-class=WORKERCLASS
|
||||||
The type of request processing to use
|
The type of request processing to use
|
||||||
[egg:gunicorn#main]
|
[egg:gunicorn#sync]
|
||||||
-w WORKERS, --workers=WORKERS
|
-w WORKERS, --workers=WORKERS
|
||||||
Number of workers to spawn. [1]
|
Number of workers to spawn. [1]
|
||||||
-p PIDFILE, --pid=PIDFILE
|
-p PIDFILE, --pid=PIDFILE
|
||||||
|
|||||||
@ -45,7 +45,7 @@ Full command line usage
|
|||||||
unix:/tmp/gunicorn.sock
|
unix:/tmp/gunicorn.sock
|
||||||
-k WORKERCLASS, --worker-class=WORKERCLASS
|
-k WORKERCLASS, --worker-class=WORKERCLASS
|
||||||
The type of request processing to use
|
The type of request processing to use
|
||||||
[egg:gunicorn#main]
|
[egg:gunicorn#sync]
|
||||||
-w WORKERS, --workers=WORKERS
|
-w WORKERS, --workers=WORKERS
|
||||||
Number of workers to spawn. [1]
|
Number of workers to spawn. [1]
|
||||||
-p PIDFILE, --pid=PIDFILE
|
-p PIDFILE, --pid=PIDFILE
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import os
|
|||||||
import select
|
import select
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,6 @@
|
|||||||
"""The debug module contains utilities and functions for better
|
"""The debug module contains utilities and functions for better
|
||||||
debugging Gunicorn."""
|
debugging Gunicorn."""
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
import linecache
|
import linecache
|
||||||
import re
|
import re
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# This file is part of gunicorn released under the MIT license.
|
# This file is part of gunicorn released under the MIT license.
|
||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
from gunicorn.util import close, http_date, write, write_chunk, is_hoppish
|
from gunicorn.util import http_date, write, write_chunk, is_hoppish
|
||||||
|
|
||||||
class Response(object):
|
class Response(object):
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ def options():
|
|||||||
help='Number of workers to spawn. [1]'),
|
help='Number of workers to spawn. [1]'),
|
||||||
op.make_option('-k', '--worker-class', dest='workerclass',
|
op.make_option('-k', '--worker-class', dest='workerclass',
|
||||||
help="The type of request processing to use "+
|
help="The type of request processing to use "+
|
||||||
"[egg:gunicorn#main]"),
|
"[egg:gunicorn#sync]"),
|
||||||
op.make_option('-p','--pid', dest='pidfile',
|
op.make_option('-p','--pid', dest='pidfile',
|
||||||
help='set the background PID FILE'),
|
help='set the background PID FILE'),
|
||||||
op.make_option('-D', '--daemon', dest='daemon', action="store_true",
|
op.make_option('-D', '--daemon', dest='daemon', action="store_true",
|
||||||
@ -163,10 +163,10 @@ def run_paster():
|
|||||||
relpath = os.path.dirname(cfgfname)
|
relpath = os.path.dirname(cfgfname)
|
||||||
|
|
||||||
# load module in sys path
|
# load module in sys path
|
||||||
sys.path.insert(0, relative_to)
|
sys.path.insert(0, relpath)
|
||||||
|
|
||||||
# add to eggs
|
# add to eggs
|
||||||
pkg_resources.working_set.add_entry(relative_to)
|
pkg_resources.working_set.add_entry(relpath)
|
||||||
ctx = loadwsgi.loadcontext(loadwsgi.SERVER, cfgurl, relative_to=relpath)
|
ctx = loadwsgi.loadcontext(loadwsgi.SERVER, cfgurl, relative_to=relpath)
|
||||||
|
|
||||||
if not opts.workers:
|
if not opts.workers:
|
||||||
@ -196,7 +196,7 @@ def run_paster():
|
|||||||
|
|
||||||
opts.default_proc_name= ctx.global_conf.get('__file__')
|
opts.default_proc_name= ctx.global_conf.get('__file__')
|
||||||
|
|
||||||
app = loadapp(config_url, relative_to=relative_to)
|
app = loadapp(cfgurl, relative_to=relpath)
|
||||||
return app
|
return app
|
||||||
|
|
||||||
main("%prog [OPTIONS] pasteconfig.ini", get_app)
|
main("%prog [OPTIONS] pasteconfig.ini", get_app)
|
||||||
|
|||||||
@ -15,7 +15,6 @@ from django.utils import translation
|
|||||||
from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException
|
from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException
|
||||||
from django.core.handlers.wsgi import WSGIHandler
|
from django.core.handlers.wsgi import WSGIHandler
|
||||||
|
|
||||||
from gunicorn.arbiter import Arbiter
|
|
||||||
from gunicorn.config import Config
|
from gunicorn.config import Config
|
||||||
from gunicorn.main import daemonize, configure_logging
|
from gunicorn.main import daemonize, configure_logging
|
||||||
|
|
||||||
@ -25,11 +24,11 @@ class Command(BaseCommand):
|
|||||||
help='Specifies the directory from which to serve admin media.'),
|
help='Specifies the directory from which to serve admin media.'),
|
||||||
make_option('-c', '--config', dest='gconfig', type='string',
|
make_option('-c', '--config', dest='gconfig', type='string',
|
||||||
help='Gunicorn Config file. [%default]'),
|
help='Gunicorn Config file. [%default]'),
|
||||||
|
make_option('-k', '--worker-class', dest='workerclass',
|
||||||
|
help="The type of request processing to use "+
|
||||||
|
"[egg:gunicorn#sync]"),
|
||||||
make_option('-w', '--workers', dest='workers',
|
make_option('-w', '--workers', dest='workers',
|
||||||
help='Specifies the number of worker processes to use.'),
|
help='Specifies the number of worker processes to use.'),
|
||||||
make_option('-a', '--arbiter', dest='arbiter',
|
|
||||||
help="gunicorn arbiter entry point or module "+
|
|
||||||
"[egg:gunicorn#main]"),
|
|
||||||
make_option('--pid', dest='pidfile',
|
make_option('--pid', dest='pidfile',
|
||||||
help='set the background PID file'),
|
help='set the background PID file'),
|
||||||
make_option( '--daemon', dest='daemon', action="store_true",
|
make_option( '--daemon', dest='daemon', action="store_true",
|
||||||
|
|||||||
@ -4,8 +4,6 @@
|
|||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import os
|
|
||||||
import select
|
|
||||||
import socket
|
import socket
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|||||||
@ -5,24 +5,15 @@
|
|||||||
|
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
import collections
|
|
||||||
import errno
|
|
||||||
import traceback
|
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
import eventlet.debug
|
import eventlet.debug
|
||||||
|
|
||||||
from eventlet.green import os
|
from eventlet.green import os
|
||||||
from eventlet.green import socket
|
|
||||||
from eventlet import greenio
|
|
||||||
from eventlet import greenlet
|
from eventlet import greenlet
|
||||||
from eventlet import greenpool
|
from eventlet import greenpool
|
||||||
from eventlet import greenthread
|
from eventlet import greenthread
|
||||||
|
|
||||||
from gunicorn import util
|
from gunicorn.workers.async import AsyncWorker
|
||||||
from gunicorn import arbiter
|
|
||||||
from gunicorn.workers.async import AsyncWorker, ALREADY_HANDLED
|
|
||||||
from gunicorn.http.tee import UnexpectedEOF
|
|
||||||
|
|
||||||
eventlet.debug.hub_exceptions(True)
|
eventlet.debug.hub_exceptions(True)
|
||||||
|
|
||||||
@ -57,11 +48,11 @@ class EventletWorker(AsyncWorker):
|
|||||||
|
|
||||||
eventlet.sleep(0.1)
|
eventlet.sleep(0.1)
|
||||||
|
|
||||||
with evenlet.Timeout(self.timeout, False):
|
with eventlet.Timeout(self.timeout, False):
|
||||||
pool.waitall()
|
pool.waitall()
|
||||||
|
|
||||||
def acceptor(self, pool):
|
def acceptor(self, pool):
|
||||||
server_gt = greenthread.getcurrent()
|
greenthread.getcurrent()
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
conn, addr = self.socket.accept()
|
conn, addr = self.socket.accept()
|
||||||
|
|||||||
@ -5,20 +5,15 @@
|
|||||||
|
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
import errno
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import gevent
|
import gevent
|
||||||
from gevent import monkey
|
from gevent import monkey
|
||||||
monkey.noisy = False
|
monkey.noisy = False
|
||||||
from gevent import socket
|
|
||||||
from gevent import greenlet
|
from gevent import greenlet
|
||||||
from gevent.pool import Pool
|
from gevent.pool import Pool
|
||||||
|
|
||||||
from gunicorn import util
|
from gunicorn.workers.async import AsyncWorker
|
||||||
from gunicorn import arbiter
|
|
||||||
from gunicorn.workers.async import AsyncWorker, ALREADY_HANDLED
|
|
||||||
from gunicorn.http.tee import UnexpectedEOF
|
|
||||||
|
|
||||||
class GEventWorker(AsyncWorker):
|
class GEventWorker(AsyncWorker):
|
||||||
|
|
||||||
@ -54,7 +49,7 @@ class GEventWorker(AsyncWorker):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def acceptor(self, pool):
|
def acceptor(self, pool):
|
||||||
server_gt = gevent.getcurrent()
|
gevent.getcurrent()
|
||||||
while self.alive:
|
while self.alive:
|
||||||
try:
|
try:
|
||||||
conn, addr = self.socket.accept()
|
conn, addr = self.socket.accept()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user