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
1bb128b8
Commit
1bb128b8
authored
Sep 15, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep8
parent
d70a3fd1
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
44 additions
and
57 deletions
+44
-57
gevent/__init__.py
gevent/__init__.py
+1
-1
gevent/backdoor.py
gevent/backdoor.py
+1
-2
gevent/baseserver.py
gevent/baseserver.py
+0
-1
gevent/coros.py
gevent/coros.py
+1
-2
gevent/dns.py
gevent/dns.py
+1
-1
gevent/event.py
gevent/event.py
+4
-5
gevent/greenlet.py
gevent/greenlet.py
+1
-2
gevent/http.py
gevent/http.py
+0
-1
gevent/hub.py
gevent/hub.py
+6
-5
gevent/local.py
gevent/local.py
+1
-0
gevent/pool.py
gevent/pool.py
+5
-6
gevent/pywsgi.py
gevent/pywsgi.py
+4
-7
gevent/queue.py
gevent/queue.py
+2
-3
gevent/rawgreenlet.py
gevent/rawgreenlet.py
+2
-3
gevent/select.py
gevent/select.py
+0
-1
gevent/server.py
gevent/server.py
+2
-3
gevent/sslold.py
gevent/sslold.py
+2
-2
gevent/timeout.py
gevent/timeout.py
+10
-10
gevent/util.py
gevent/util.py
+1
-1
gevent/win32util.py
gevent/win32util.py
+0
-1
No files found.
gevent/__init__.py
View file @
1bb128b8
gevent/backdoor.py
View file @
1bb128b8
...
...
@@ -115,4 +115,3 @@ if __name__ == '__main__':
print
'USAGE: %s PORT'
%
sys
.
argv
[
0
]
else
:
BackdoorServer
((
'127.0.0.1'
,
int
(
sys
.
argv
[
1
]))).
serve_forever
()
gevent/baseserver.py
View file @
1bb128b8
...
...
@@ -196,4 +196,3 @@ def _tcp_listener(address, backlog=50, reuse_addr=None):
sock
.
listen
(
backlog
)
sock
.
setblocking
(
0
)
return
sock
gevent/coros.py
View file @
1bb128b8
...
...
@@ -232,4 +232,3 @@ class RLock(object):
def
_is_owned
(
self
):
return
self
.
_owner
is
getcurrent
()
gevent/dns.py
View file @
1bb128b8
...
...
@@ -36,7 +36,7 @@ class DNSError(gaierror):
"""
def
__init__
(
self
,
*
args
):
if
len
(
args
)
==
1
:
if
len
(
args
)
==
1
:
code
=
args
[
0
]
gaierror
.
__init__
(
self
,
code
,
core
.
dns_err_to_string
(
code
))
else
:
...
...
gevent/event.py
View file @
1bb128b8
...
...
@@ -320,4 +320,3 @@ def waitall(events):
finally
:
for
event
in
events
:
event
.
unlink
(
put
)
gevent/greenlet.py
View file @
1bb128b8
...
...
@@ -228,7 +228,7 @@ class Greenlet(greenlet):
# the result was not set and the links weren't notified. let's do it here.
# checking that self.dead is true is essential, because the exception raised by
# throw() could have been cancelled by the greenlet's function.
if
len
(
args
)
==
1
:
if
len
(
args
)
==
1
:
arg
=
args
[
0
]
#if isinstance(arg, type):
if
type
(
arg
)
is
type
(
Exception
):
...
...
@@ -614,4 +614,3 @@ def getfuncname(func):
_NONE
=
Exception
(
"Neither exception nor value"
)
gevent/http.py
View file @
1bb128b8
...
...
@@ -47,4 +47,3 @@ class HTTPServer(BaseServer):
def
stop_accepting
(
self
):
self
.
http
=
None
gevent/hub.py
View file @
1bb128b8
...
...
@@ -100,8 +100,9 @@ def _wrap_signal_handler(handler, args, kwargs):
except
:
core
.
active_event
(
MAIN
.
throw
,
*
sys
.
exc_info
())
def
signal
(
signalnum
,
handler
,
*
args
,
**
kwargs
):
return
core
.
signal
(
signalnum
,
lambda
:
spawn_raw
(
_wrap_signal_handler
,
handler
,
args
,
kwargs
))
return
core
.
signal
(
signalnum
,
lambda
:
spawn_raw
(
_wrap_signal_handler
,
handler
,
args
,
kwargs
))
if
_original_fork
is
not
None
:
...
...
@@ -329,8 +330,8 @@ class Waiter(object):
class
_NONE
(
object
):
"A special thingy you must never pass to any of gevent API"
__slots__
=
[]
def
__repr__
(
self
):
return
'<_NONE>'
_NONE
=
_NONE
()
gevent/local.py
View file @
1bb128b8
...
...
@@ -132,6 +132,7 @@ from gevent.coros import RLock
__all__
=
[
"local"
]
class
_localbase
(
object
):
__slots__
=
'_local__args'
,
'_local__lock'
,
'_local__dicts'
...
...
gevent/pool.py
View file @
1bb128b8
...
...
@@ -26,7 +26,7 @@ class Group(object):
greenlet_class
=
Greenlet
def
__init__
(
self
,
*
args
):
assert
len
(
args
)
<=
1
,
args
assert
len
(
args
)
<=
1
,
args
self
.
greenlets
=
set
(
*
args
)
if
args
:
for
greenlet
in
args
[
0
]:
...
...
@@ -315,4 +315,3 @@ class pass_value(object):
def
__getattr__
(
self
,
item
):
assert
item
!=
'callback'
return
getattr
(
self
.
callback
,
item
)
gevent/pywsgi.py
View file @
1bb128b8
...
...
@@ -19,14 +19,11 @@ __all__ = ['WSGIHandler', 'WSGIServer']
MAX_REQUEST_LINE
=
8192
# Weekday and month names for HTTP date/time formatting; always English!
_WEEKDAYNAME
=
[
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
,
"Sun"
]
_MONTHNAME
=
[
None
,
# Dummy so we can use 1-based month numbers
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
]
_INTERNAL_ERROR_STATUS
=
'500 Internal Server Error'
_INTERNAL_ERROR_BODY
=
'Internal Server Error'
_INTERNAL_ERROR_HEADERS
=
[(
'Content-Type'
,
'text/plain'
),
...
...
@@ -34,9 +31,9 @@ _INTERNAL_ERROR_HEADERS = [('Content-Type', 'text/plain'),
(
'Content-Length'
,
str
(
len
(
_INTERNAL_ERROR_BODY
)))]
_REQUEST_TOO_LONG_RESPONSE
=
"HTTP/1.0 414 Request URI Too Long
\
r
\
n
Connection: close
\
r
\
n
Content-length: 0
\
r
\
n
\
r
\
n
"
_BAD_REQUEST_RESPONSE
=
"HTTP/1.0 400 Bad Request
\
r
\
n
Connection: close
\
r
\
n
Content-length: 0
\
r
\
n
\
r
\
n
"
_CONTINUE_RESPONSE
=
"HTTP/1.1 100 Continue
\
r
\
n
\
r
\
n
"
def
format_date_time
(
timestamp
):
year
,
month
,
day
,
hh
,
mm
,
ss
,
wd
,
_y
,
_z
=
time
.
gmtime
(
timestamp
)
return
"%s, %02d %3s %4d %02d:%02d:%02d GMT"
%
(
_WEEKDAYNAME
[
wd
],
day
,
_MONTHNAME
[
month
],
year
,
hh
,
mm
,
ss
)
...
...
gevent/queue.py
View file @
1bb128b8
...
...
@@ -315,4 +315,3 @@ class JoinableQueue(Queue):
unfinished tasks drops to zero, :meth:`join` unblocks.
'''
self
.
_cond
.
wait
()
gevent/rawgreenlet.py
View file @
1bb128b8
...
...
@@ -74,7 +74,7 @@ def join(greenlet, polling_period=0.2):
"""Wait for a greenlet to finish by polling its status"""
delay
=
0.002
while
not
greenlet
.
dead
:
delay
=
min
(
polling_period
,
delay
*
2
)
delay
=
min
(
polling_period
,
delay
*
2
)
sleep
(
delay
)
...
...
@@ -85,8 +85,7 @@ def joinall(greenlets, polling_period=0.2):
current
+=
1
delay
=
0.002
while
current
<
len
(
greenlets
):
delay
=
min
(
polling_period
,
delay
*
2
)
delay
=
min
(
polling_period
,
delay
*
2
)
sleep
(
delay
)
while
current
<
len
(
greenlets
)
and
greenlets
[
current
].
dead
:
current
+=
1
gevent/select.py
View file @
1bb128b8
...
...
@@ -65,4 +65,3 @@ def select(rlist, wlist, xlist, timeout=None):
for
evt
in
allevents
:
evt
.
cancel
()
timeout
.
cancel
()
gevent/server.py
View file @
1bb128b8
...
...
@@ -114,7 +114,7 @@ class StreamServer(BaseServer):
try
:
client_socket
,
address
=
self
.
socket
.
accept
()
except
socket
.
error
,
err
:
if
err
[
0
]
==
errno
.
EAGAIN
:
if
err
[
0
]
==
errno
.
EAGAIN
:
sys
.
exc_clear
()
return
raise
...
...
@@ -144,7 +144,7 @@ class StreamServer(BaseServer):
if
self
.
delay
>=
0
:
self
.
stop_accepting
()
self
.
_start_accepting_timer
=
core
.
timer
(
self
.
delay
,
self
.
start_accepting
)
self
.
delay
=
min
(
self
.
max_delay
,
self
.
delay
*
2
)
self
.
delay
=
min
(
self
.
max_delay
,
self
.
delay
*
2
)
sys
.
exc_clear
()
def
is_fatal_error
(
self
,
ex
):
...
...
@@ -162,4 +162,3 @@ def _import_sslold_wrap_socket():
return
wrap_socket
except
ImportError
:
pass
gevent/sslold.py
View file @
1bb128b8
...
...
@@ -12,6 +12,7 @@ __all__ = ['ssl', 'sslerror']
try
:
sslerror
=
__socket__
.
sslerror
except
AttributeError
:
class
sslerror
(
error
):
pass
...
...
@@ -185,4 +186,3 @@ def wrap_socket(sock, keyfile=None, certfile=None,
if
locals
()[
arg
]
is
not
None
:
raise
TypeError
(
'To use argument %r install ssl package: http://pypi.python.org/pypi/ssl'
%
arg
)
return
ssl
(
sock
,
keyfile
=
keyfile
,
certfile
=
certfile
)
gevent/timeout.py
View file @
1bb128b8
...
...
@@ -23,6 +23,7 @@ __all__ = ['Timeout',
try
:
BaseException
except
NameError
:
# Python < 2.5
class
BaseException
:
# not subclassing from object() intentionally, because in
# that case "raise Timeout" fails with TypeError.
...
...
@@ -196,4 +197,3 @@ def with_timeout(seconds, function, *args, **kwds):
raise
finally
:
timeout
.
cancel
()
gevent/util.py
View file @
1bb128b8
# Copyright (c) 2009 Denis Bilenko. See LICENSE for details.
__all__
=
[
'wrap_errors'
,
'lazy_property'
]
class
wrap_errors
(
object
):
"""Helper to make function return an exception, rather than raise it.
...
...
@@ -62,4 +63,3 @@ class lazy_property(object):
value
=
self
.
_calculate
(
obj
)
setattr
(
obj
,
self
.
_calculate
.
func_name
,
value
)
return
value
gevent/win32util.py
View file @
1bb128b8
...
...
@@ -66,7 +66,6 @@ class _ErrorFormatter(object):
return
cls
(
WinError
,
FormatMessage
,
errorTab
)
fromEnvironment
=
classmethod
(
fromEnvironment
)
def
formatError
(
self
,
errorcode
):
"""
Returns the string associated with a Windows error message, such as the
...
...
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