mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Silence prospector warnings
This commit is contained in:
parent
461e186f5b
commit
31b8e48a78
@ -1,12 +1,13 @@
|
||||
from multiprocessing import Process, Queue
|
||||
import requests
|
||||
import gevent
|
||||
|
||||
|
||||
def child_process(queue):
|
||||
while True:
|
||||
print(queue.get())
|
||||
requests.get('http://requestb.in/15s95oz1')
|
||||
|
||||
|
||||
class GunicornSubProcessTestMiddleware(object):
|
||||
def __init__(self):
|
||||
super(GunicornSubProcessTestMiddleware, self).__init__()
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@ -1,5 +1,3 @@
|
||||
# Create your views here.
|
||||
|
||||
import csv
|
||||
import io
|
||||
import os
|
||||
@ -7,7 +5,7 @@ from django import forms
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render_to_response
|
||||
from django.template import RequestContext
|
||||
import tempfile
|
||||
|
||||
|
||||
class MsgForm(forms.Form):
|
||||
subject = forms.CharField(max_length=100)
|
||||
|
||||
@ -81,7 +81,7 @@ STATICFILES_FINDERS = (
|
||||
)
|
||||
|
||||
# Make this unique, and don't share it with anybody.
|
||||
SECRET_KEY = '0!jubm9ho=s_32kac4wt#$9+hb#qzsg6c7+%83hqujcdfw%5*-'
|
||||
SECRET_KEY = ''
|
||||
|
||||
# List of callables that know how to import templates from various sources.
|
||||
TEMPLATE_LOADERS = (
|
||||
|
||||
@ -17,7 +17,6 @@ class TestIter(object):
|
||||
|
||||
def app(environ, start_response):
|
||||
"""Application which cooperatively pauses 20 seconds (needed to surpass normal timeouts) before responding"""
|
||||
data = b'Hello, World!\n'
|
||||
status = '200 OK'
|
||||
response_headers = [
|
||||
('Content-type', 'text/plain'),
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import collections
|
||||
import errno
|
||||
import re
|
||||
from hashlib import md5, sha1
|
||||
from hashlib import sha1
|
||||
import base64
|
||||
from base64 import b64encode, b64decode
|
||||
import socket
|
||||
@ -106,7 +106,7 @@ class WebSocketWSGI(object):
|
||||
|
||||
try:
|
||||
self.handler(ws)
|
||||
except socket.error, e:
|
||||
except socket.error as e:
|
||||
if e[0] != errno.EPIPE:
|
||||
raise
|
||||
# use this undocumented feature of grainbows to ensure that it
|
||||
|
||||
@ -107,7 +107,7 @@ class WebSocketWSGI(object):
|
||||
|
||||
try:
|
||||
self.handler(ws)
|
||||
except socket.error, e:
|
||||
except socket.error as e:
|
||||
if e[0] != errno.EPIPE:
|
||||
raise
|
||||
# use this undocumented feature of grainbows to ensure that it
|
||||
|
||||
@ -7,7 +7,6 @@ from __future__ import print_function
|
||||
|
||||
import email.utils
|
||||
import fcntl
|
||||
import grp
|
||||
import io
|
||||
import os
|
||||
import pkg_resources
|
||||
@ -15,7 +14,6 @@ import pwd
|
||||
import random
|
||||
import resource
|
||||
import socket
|
||||
import stat
|
||||
import sys
|
||||
import textwrap
|
||||
import time
|
||||
|
||||
@ -27,7 +27,7 @@ class TornadoWorker(Worker):
|
||||
|
||||
def clear(self):
|
||||
old_clear(self)
|
||||
if not "Gunicorn" in self._headers["Server"]:
|
||||
if "Gunicorn" not in self._headers["Server"]:
|
||||
self._headers["Server"] += " (Gunicorn/%s)" % gversion
|
||||
web.RequestHandler.clear = clear
|
||||
sys.modules["tornado.web"] = web
|
||||
@ -104,13 +104,13 @@ class TornadoWorker(Worker):
|
||||
server_class = _HTTPServer
|
||||
|
||||
if self.cfg.is_ssl:
|
||||
_ssl_opt = copy.deepcopy(self.cfg.ssl_options)
|
||||
# tornado refuses initialization if ssl_options contains following
|
||||
# options
|
||||
del _ssl_opt["do_handshake_on_connect"]
|
||||
del _ssl_opt["suppress_ragged_eofs"]
|
||||
server = server_class(app, io_loop=self.ioloop,
|
||||
ssl_options=_ssl_opt)
|
||||
_ssl_opt = copy.deepcopy(self.cfg.ssl_options)
|
||||
# tornado refuses initialization if ssl_options contains following
|
||||
# options
|
||||
del _ssl_opt["do_handshake_on_connect"]
|
||||
del _ssl_opt["suppress_ragged_eofs"]
|
||||
server = server_class(app, io_loop=self.ioloop,
|
||||
ssl_options=_ssl_opt)
|
||||
else:
|
||||
server = server_class(app, io_loop=self.ioloop)
|
||||
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
# pip install validate_email pyDNS
|
||||
#
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import sys
|
||||
|
||||
from validate_email import validate_email
|
||||
|
||||
14
tests/t.py
14
tests/t.py
@ -10,7 +10,6 @@ import tempfile
|
||||
dirname = os.path.dirname(__file__)
|
||||
|
||||
from gunicorn.http.parser import RequestParser
|
||||
from gunicorn.config import Config
|
||||
from gunicorn.six import BytesIO
|
||||
|
||||
|
||||
@ -66,16 +65,3 @@ class FakeSocket(object):
|
||||
|
||||
def seek(self, offset, whence=0):
|
||||
self.tmp.seek(offset, whence)
|
||||
|
||||
|
||||
class http_request(object):
|
||||
def __init__(self, name):
|
||||
self.fname = os.path.join(dirname, "requests", name)
|
||||
|
||||
def __call__(self, func):
|
||||
def run():
|
||||
fsock = FakeSocket(data_source(self.fname))
|
||||
req = Request(Config(), fsock, ('127.0.0.1', 6000), ('127.0.0.1', 8000))
|
||||
func(req)
|
||||
run.func_name = func.func_name
|
||||
return run
|
||||
|
||||
@ -3,8 +3,6 @@
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
import t
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
from datetime import timedelta
|
||||
import socket
|
||||
|
||||
import t
|
||||
|
||||
import logging
|
||||
import tempfile
|
||||
import shutil
|
||||
|
||||
@ -3,8 +3,6 @@
|
||||
# This file is part of the pywebmachine package released
|
||||
# under the MIT license.
|
||||
|
||||
import t
|
||||
|
||||
import inspect
|
||||
import os
|
||||
import random
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user