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
|
from multiprocessing import Process, Queue
|
||||||
import requests
|
import requests
|
||||||
import gevent
|
|
||||||
|
|
||||||
def child_process(queue):
|
def child_process(queue):
|
||||||
while True:
|
while True:
|
||||||
print(queue.get())
|
print(queue.get())
|
||||||
requests.get('http://requestb.in/15s95oz1')
|
requests.get('http://requestb.in/15s95oz1')
|
||||||
|
|
||||||
|
|
||||||
class GunicornSubProcessTestMiddleware(object):
|
class GunicornSubProcessTestMiddleware(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(GunicornSubProcessTestMiddleware, self).__init__()
|
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 csv
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
@ -7,7 +5,7 @@ from django import forms
|
|||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
import tempfile
|
|
||||||
|
|
||||||
class MsgForm(forms.Form):
|
class MsgForm(forms.Form):
|
||||||
subject = forms.CharField(max_length=100)
|
subject = forms.CharField(max_length=100)
|
||||||
|
|||||||
@ -81,7 +81,7 @@ STATICFILES_FINDERS = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Make this unique, and don't share it with anybody.
|
# 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.
|
# List of callables that know how to import templates from various sources.
|
||||||
TEMPLATE_LOADERS = (
|
TEMPLATE_LOADERS = (
|
||||||
|
|||||||
@ -17,7 +17,6 @@ class TestIter(object):
|
|||||||
|
|
||||||
def app(environ, start_response):
|
def app(environ, start_response):
|
||||||
"""Application which cooperatively pauses 20 seconds (needed to surpass normal timeouts) before responding"""
|
"""Application which cooperatively pauses 20 seconds (needed to surpass normal timeouts) before responding"""
|
||||||
data = b'Hello, World!\n'
|
|
||||||
status = '200 OK'
|
status = '200 OK'
|
||||||
response_headers = [
|
response_headers = [
|
||||||
('Content-type', 'text/plain'),
|
('Content-type', 'text/plain'),
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
import collections
|
import collections
|
||||||
import errno
|
import errno
|
||||||
import re
|
import re
|
||||||
from hashlib import md5, sha1
|
from hashlib import sha1
|
||||||
import base64
|
import base64
|
||||||
from base64 import b64encode, b64decode
|
from base64 import b64encode, b64decode
|
||||||
import socket
|
import socket
|
||||||
@ -106,7 +106,7 @@ class WebSocketWSGI(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.handler(ws)
|
self.handler(ws)
|
||||||
except socket.error, e:
|
except socket.error as e:
|
||||||
if e[0] != errno.EPIPE:
|
if e[0] != errno.EPIPE:
|
||||||
raise
|
raise
|
||||||
# use this undocumented feature of grainbows to ensure that it
|
# use this undocumented feature of grainbows to ensure that it
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class WebSocketWSGI(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.handler(ws)
|
self.handler(ws)
|
||||||
except socket.error, e:
|
except socket.error as e:
|
||||||
if e[0] != errno.EPIPE:
|
if e[0] != errno.EPIPE:
|
||||||
raise
|
raise
|
||||||
# use this undocumented feature of grainbows to ensure that it
|
# use this undocumented feature of grainbows to ensure that it
|
||||||
|
|||||||
@ -7,7 +7,6 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import email.utils
|
import email.utils
|
||||||
import fcntl
|
import fcntl
|
||||||
import grp
|
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
@ -15,7 +14,6 @@ import pwd
|
|||||||
import random
|
import random
|
||||||
import resource
|
import resource
|
||||||
import socket
|
import socket
|
||||||
import stat
|
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
import time
|
import time
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class TornadoWorker(Worker):
|
|||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
old_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
|
self._headers["Server"] += " (Gunicorn/%s)" % gversion
|
||||||
web.RequestHandler.clear = clear
|
web.RequestHandler.clear = clear
|
||||||
sys.modules["tornado.web"] = web
|
sys.modules["tornado.web"] = web
|
||||||
@ -104,13 +104,13 @@ class TornadoWorker(Worker):
|
|||||||
server_class = _HTTPServer
|
server_class = _HTTPServer
|
||||||
|
|
||||||
if self.cfg.is_ssl:
|
if self.cfg.is_ssl:
|
||||||
_ssl_opt = copy.deepcopy(self.cfg.ssl_options)
|
_ssl_opt = copy.deepcopy(self.cfg.ssl_options)
|
||||||
# tornado refuses initialization if ssl_options contains following
|
# tornado refuses initialization if ssl_options contains following
|
||||||
# options
|
# options
|
||||||
del _ssl_opt["do_handshake_on_connect"]
|
del _ssl_opt["do_handshake_on_connect"]
|
||||||
del _ssl_opt["suppress_ragged_eofs"]
|
del _ssl_opt["suppress_ragged_eofs"]
|
||||||
server = server_class(app, io_loop=self.ioloop,
|
server = server_class(app, io_loop=self.ioloop,
|
||||||
ssl_options=_ssl_opt)
|
ssl_options=_ssl_opt)
|
||||||
else:
|
else:
|
||||||
server = server_class(app, io_loop=self.ioloop)
|
server = server_class(app, io_loop=self.ioloop)
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
# pip install validate_email pyDNS
|
# pip install validate_email pyDNS
|
||||||
#
|
#
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from validate_email import validate_email
|
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__)
|
dirname = os.path.dirname(__file__)
|
||||||
|
|
||||||
from gunicorn.http.parser import RequestParser
|
from gunicorn.http.parser import RequestParser
|
||||||
from gunicorn.config import Config
|
|
||||||
from gunicorn.six import BytesIO
|
from gunicorn.six import BytesIO
|
||||||
|
|
||||||
|
|
||||||
@ -66,16 +65,3 @@ class FakeSocket(object):
|
|||||||
|
|
||||||
def seek(self, offset, whence=0):
|
def seek(self, offset, whence=0):
|
||||||
self.tmp.seek(offset, whence)
|
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.
|
# This file is part of gunicorn released under the MIT license.
|
||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
import t
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,5 @@
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
import t
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import tempfile
|
import tempfile
|
||||||
import shutil
|
import shutil
|
||||||
|
|||||||
@ -3,8 +3,6 @@
|
|||||||
# This file is part of the pywebmachine package released
|
# This file is part of the pywebmachine package released
|
||||||
# under the MIT license.
|
# under the MIT license.
|
||||||
|
|
||||||
import t
|
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user