fix erros spotted by pyflakes

This commit is contained in:
benoitc 2010-04-22 19:41:29 +02:00
parent 57d6f1b507
commit 5b2f98fca4
10 changed files with 15 additions and 34 deletions

View File

@ -52,7 +52,7 @@ Usage
unix:/tmp/gunicorn.sock
-k WORKERCLASS, --worker-class=WORKERCLASS
The type of request processing to use
[egg:gunicorn#main]
[egg:gunicorn#sync]
-w WORKERS, --workers=WORKERS
Number of workers to spawn. [1]
-p PIDFILE, --pid=PIDFILE

View File

@ -45,7 +45,7 @@ Full command line usage
unix:/tmp/gunicorn.sock
-k WORKERCLASS, --worker-class=WORKERCLASS
The type of request processing to use
[egg:gunicorn#main]
[egg:gunicorn#sync]
-w WORKERS, --workers=WORKERS
Number of workers to spawn. [1]
-p PIDFILE, --pid=PIDFILE

View File

@ -12,7 +12,6 @@ import os
import select
import signal
import sys
import tempfile
import time
import traceback

View File

@ -6,7 +6,6 @@
"""The debug module contains utilities and functions for better
debugging Gunicorn."""
import os
import sys
import linecache
import re

View File

@ -3,7 +3,7 @@
# This file is part of gunicorn released under the MIT license.
# 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):

View File

@ -35,7 +35,7 @@ def options():
help='Number of workers to spawn. [1]'),
op.make_option('-k', '--worker-class', dest='workerclass',
help="The type of request processing to use "+
"[egg:gunicorn#main]"),
"[egg:gunicorn#sync]"),
op.make_option('-p','--pid', dest='pidfile',
help='set the background PID FILE'),
op.make_option('-D', '--daemon', dest='daemon', action="store_true",
@ -163,10 +163,10 @@ def run_paster():
relpath = os.path.dirname(cfgfname)
# load module in sys path
sys.path.insert(0, relative_to)
sys.path.insert(0, relpath)
# 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)
if not opts.workers:
@ -196,7 +196,7 @@ def run_paster():
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
main("%prog [OPTIONS] pasteconfig.ini", get_app)

View File

@ -15,7 +15,6 @@ from django.utils import translation
from django.core.servers.basehttp import AdminMediaHandler, WSGIServerException
from django.core.handlers.wsgi import WSGIHandler
from gunicorn.arbiter import Arbiter
from gunicorn.config import Config
from gunicorn.main import daemonize, configure_logging
@ -25,11 +24,11 @@ class Command(BaseCommand):
help='Specifies the directory from which to serve admin media.'),
make_option('-c', '--config', dest='gconfig', type='string',
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',
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',
help='set the background PID file'),
make_option( '--daemon', dest='daemon', action="store_true",

View File

@ -4,8 +4,6 @@
# See the NOTICE for more information.
import errno
import os
import select
import socket
import traceback

View File

@ -5,24 +5,15 @@
from __future__ import with_statement
import collections
import errno
import traceback
import eventlet
import eventlet.debug
from eventlet.green import os
from eventlet.green import socket
from eventlet import greenio
from eventlet import greenlet
from eventlet import greenpool
from eventlet import greenthread
from gunicorn import util
from gunicorn import arbiter
from gunicorn.workers.async import AsyncWorker, ALREADY_HANDLED
from gunicorn.http.tee import UnexpectedEOF
from gunicorn.workers.async import AsyncWorker
eventlet.debug.hub_exceptions(True)
@ -57,11 +48,11 @@ class EventletWorker(AsyncWorker):
eventlet.sleep(0.1)
with evenlet.Timeout(self.timeout, False):
with eventlet.Timeout(self.timeout, False):
pool.waitall()
def acceptor(self, pool):
server_gt = greenthread.getcurrent()
greenthread.getcurrent()
while True:
try:
conn, addr = self.socket.accept()

View File

@ -5,20 +5,15 @@
from __future__ import with_statement
import errno
import os
import gevent
from gevent import monkey
monkey.noisy = False
from gevent import socket
from gevent import greenlet
from gevent.pool import Pool
from gunicorn import util
from gunicorn import arbiter
from gunicorn.workers.async import AsyncWorker, ALREADY_HANDLED
from gunicorn.http.tee import UnexpectedEOF
from gunicorn.workers.async import AsyncWorker
class GEventWorker(AsyncWorker):
@ -54,7 +49,7 @@ class GEventWorker(AsyncWorker):
pass
def acceptor(self, pool):
server_gt = gevent.getcurrent()
gevent.getcurrent()
while self.alive:
try:
conn, addr = self.socket.accept()