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
f4926a74
Commit
f4926a74
authored
May 15, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pywsgi.WSGIServer: remove log_message function; add environ argument
parent
37f7c039
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
gevent/pywsgi.py
gevent/pywsgi.py
+21
-9
No files found.
gevent/pywsgi.py
View file @
f4926a74
...
...
@@ -212,7 +212,9 @@ class WSGIHandler(BaseHTTPServer.BaseHTTPRequestHandler):
return
safe_write
def
log_request
(
self
,
*
args
):
self
.
server
.
log_message
(
self
.
format_request
(
*
args
))
log
=
self
.
server
.
log
if
log
is
not
None
:
log
.
write
(
self
.
format_request
(
*
args
)
+
'
\
n
'
)
def
format_request
(
self
,
length
=
'-'
):
return
'%s - - [%s] "%s" %s %s %.6f'
%
(
...
...
@@ -321,26 +323,36 @@ class WSGIServer(StreamServer):
'SERVER_SOFTWARE'
:
'gevent/%d.%d Python/%d.%d'
%
(
gevent
.
version_info
[:
2
]
+
sys
.
version_info
[:
2
]),
'SCRIPT_NAME'
:
''
,
'wsgi.version'
:
(
1
,
0
),
'wsgi.errors'
:
sys
.
stderr
,
'wsgi.multithread'
:
False
,
'wsgi.multiprocess'
:
False
,
'wsgi.run_once'
:
False
}
def
__init__
(
self
,
listener
,
application
=
None
,
backlog
=
None
,
spawn
=
'default'
,
log
=
sys
.
stderr
,
handler_class
=
None
,
**
ssl_args
):
def
__init__
(
self
,
listener
,
application
=
None
,
backlog
=
None
,
spawn
=
'default'
,
log
=
None
,
handler_class
=
None
,
environ
=
None
,
**
ssl_args
):
StreamServer
.
__init__
(
self
,
listener
,
backlog
=
backlog
,
spawn
=
spawn
,
**
ssl_args
)
if
application
is
not
None
:
self
.
application
=
application
if
handler_class
is
not
None
:
self
.
handler_class
=
handler_class
if
log
is
None
:
self
.
log
=
sys
.
stderr
else
:
self
.
log
=
log
self
.
set_environ
(
environ
)
def
set_environ
(
self
,
environ
=
None
):
if
environ
is
not
None
:
self
.
environ
=
environ
environ_update
=
getattr
(
self
,
'environ'
,
None
)
self
.
environ
=
self
.
base_env
.
copy
()
if
self
.
ssl_enabled
:
self
.
environ
[
'wsgi.url_scheme'
]
=
'https'
else
:
self
.
environ
[
'wsgi.url_scheme'
]
=
'http'
if
application
is
not
None
:
self
.
application
=
application
self
.
log
=
log
def
log_message
(
self
,
message
):
self
.
log
.
write
(
message
+
'
\
n
'
)
if
environ_update
is
not
None
:
self
.
environ
.
update
(
environ_update
)
if
self
.
environ
.
get
(
'wsgi.errors'
)
is
None
:
self
.
environ
[
'wsgi.errors'
]
=
sys
.
stderr
def
get_environ
(
self
):
return
self
.
environ
.
copy
()
...
...
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