Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
8880f88d
Commit
8880f88d
authored
Sep 11, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add handler_class classvariable to WSGIServer; allow overriding it in __init__
parent
bae0632b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
gevent/wsgi2.py
gevent/wsgi2.py
+5
-2
No files found.
gevent/wsgi2.py
View file @
8880f88d
...
...
@@ -106,7 +106,7 @@ class WSGIHandler(object):
class
WSGIServer
(
HTTPServer
):
WSGIHandler
=
WSGIHandler
handler_class
=
WSGIHandler
base_env
=
{
'SCRIPT_NAME'
:
''
,
'GATEWAY_INTERFACE'
:
'CGI/1.1'
,
...
...
@@ -118,6 +118,9 @@ class WSGIServer(HTTPServer):
'wsgi.run_once'
:
False
}
def
__init__
(
self
,
socket_or_address
,
application
,
**
kwargs
):
handler_class
=
kwargs
.
pop
(
'handler_class'
,
None
)
if
handler_class
is
not
None
:
self
.
handler_class
=
handler_class
HTTPServer
.
__init__
(
self
,
**
kwargs
)
self
.
address
=
socket_or_address
self
.
application
=
application
...
...
@@ -142,7 +145,7 @@ class WSGIServer(HTTPServer):
return
sock
def
handle
(
self
,
req
):
handler
=
self
.
WSGIHandler
(
req
)
handler
=
self
.
handler_class
(
req
)
handler
.
handle
(
self
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment