Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
tornadoweb
Tornado
提交
06c09038
Tornado
项目概览
镜像
/
tornadoweb
/
Tornado
10 个月 前同步成功
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Tornado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
06c09038
编写于
8月 27, 2012
作者:
B
Ben Darnell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Autopep8 cleanups.
上级
0cb3924a
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
17 addition
and
9 deletion
+17
-9
tornado/auth.py
tornado/auth.py
+1
-1
tornado/iostream.py
tornado/iostream.py
+0
-1
tornado/platform/twisted.py
tornado/platform/twisted.py
+1
-1
tornado/stack_context.py
tornado/stack_context.py
+1
-1
tornado/test/httpserver_test.py
tornado/test/httpserver_test.py
+1
-1
tornado/test/iostream_test.py
tornado/test/iostream_test.py
+7
-1
tornado/test/locale_test.py
tornado/test/locale_test.py
+1
-0
tornado/test/options_test.py
tornado/test/options_test.py
+1
-0
tornado/test/runtests.py
tornado/test/runtests.py
+1
-1
tornado/test/twisted_test.py
tornado/test/twisted_test.py
+1
-0
tornado/test/wsgi_test.py
tornado/test/wsgi_test.py
+1
-0
tornado/testing.py
tornado/testing.py
+0
-1
tornado/web.py
tornado/web.py
+1
-1
未找到文件。
tornado/auth.py
浏览文件 @
06c09038
...
...
@@ -862,7 +862,7 @@ class FacebookMixin(object):
self
.
_on_get_user_info
,
callback
,
session
),
session_key
=
session
[
"session_key"
],
uids
=
session
[
"uid"
],
fields
=
"uid,first_name,last_name,name,locale,pic_square,"
\
fields
=
"uid,first_name,last_name,name,locale,pic_square,"
"profile_url,username"
)
def
facebook_request
(
self
,
method
,
callback
,
**
args
):
...
...
tornado/iostream.py
浏览文件 @
06c09038
...
...
@@ -670,7 +670,6 @@ class SSLIOStream(IOStream):
self
.
_ssl_connect_callback
=
None
self
.
_run_callback
(
callback
)
def
_handle_read
(
self
):
if
self
.
_ssl_accepting
:
self
.
_do_ssl_handshake
()
...
...
tornado/platform/twisted.py
浏览文件 @
06c09038
...
...
@@ -281,7 +281,7 @@ class TornadoReactor(PosixReactorBase):
# IOLoop.start() instead of Reactor.run().
def
stop
(
self
):
PosixReactorBase
.
stop
(
self
)
fire_shutdown
=
functools
.
partial
(
self
.
fireSystemEvent
,
"shutdown"
)
fire_shutdown
=
functools
.
partial
(
self
.
fireSystemEvent
,
"shutdown"
)
self
.
_io_loop
.
add_callback
(
fire_shutdown
)
def
crash
(
self
):
...
...
tornado/stack_context.py
浏览文件 @
06c09038
...
...
@@ -197,7 +197,7 @@ def wrap(fn):
def
wrapped
(
*
args
,
**
kwargs
):
callback
,
contexts
,
args
=
args
[
0
],
args
[
1
],
args
[
2
:]
if
contexts
is
_state
.
contexts
or
not
contexts
:
callback
(
*
args
,
**
kwargs
)
return
...
...
tornado/test/httpserver_test.py
浏览文件 @
06c09038
...
...
@@ -56,7 +56,7 @@ class BaseSSLTest(AsyncHTTPSTestCase, LogTrapTestCase):
class
SSLTestMixin
(
object
):
def
get_ssl_options
(
self
):
return
dict
(
ssl_version
=
self
.
get_ssl_version
(),
return
dict
(
ssl_version
=
self
.
get_ssl_version
(),
**
AsyncHTTPSTestCase
.
get_ssl_options
())
def
get_ssl_version
(
self
):
...
...
tornado/test/iostream_test.py
浏览文件 @
06c09038
...
...
@@ -79,6 +79,7 @@ class TestIOStreamWebMixin(object):
def
test_write_while_connecting
(
self
):
stream
=
self
.
_make_client_iostream
()
connected
=
[
False
]
def
connected_callback
():
connected
[
0
]
=
True
self
.
stop
()
...
...
@@ -87,6 +88,7 @@ class TestIOStreamWebMixin(object):
# unlike the previous tests, try to write before the connection
# is complete.
written
=
[
False
]
def
write_callback
():
written
[
0
]
=
True
self
.
stop
()
...
...
@@ -111,7 +113,7 @@ class TestIOStreamMixin(object):
def
_make_server_iostream
(
self
,
connection
,
**
kwargs
):
raise
NotImplementedError
()
def
_make_client_iostream
(
self
,
connection
,
**
kwargs
):
def
_make_client_iostream
(
self
,
connection
,
**
kwargs
):
raise
NotImplementedError
()
def
make_iostream_pair
(
self
,
**
kwargs
):
...
...
@@ -346,16 +348,19 @@ class TestIOStreamMixin(object):
server
.
close
()
client
.
close
()
class
TestIOStreamWebHTTP
(
TestIOStreamWebMixin
,
AsyncHTTPTestCase
,
LogTrapTestCase
):
def
_make_client_iostream
(
self
):
return
IOStream
(
socket
.
socket
(),
io_loop
=
self
.
io_loop
)
class
TestIOStreamWebHTTPS
(
TestIOStreamWebMixin
,
AsyncHTTPSTestCase
,
LogTrapTestCase
):
def
_make_client_iostream
(
self
):
return
SSLIOStream
(
socket
.
socket
(),
io_loop
=
self
.
io_loop
)
class
TestIOStream
(
TestIOStreamMixin
,
AsyncTestCase
,
LogTrapTestCase
):
def
_make_server_iostream
(
self
,
connection
,
**
kwargs
):
return
IOStream
(
connection
,
io_loop
=
self
.
io_loop
,
**
kwargs
)
...
...
@@ -363,6 +368,7 @@ class TestIOStream(TestIOStreamMixin, AsyncTestCase, LogTrapTestCase):
def
_make_client_iostream
(
self
,
connection
,
**
kwargs
):
return
IOStream
(
connection
,
io_loop
=
self
.
io_loop
,
**
kwargs
)
class
TestIOStreamSSL
(
TestIOStreamMixin
,
AsyncTestCase
,
LogTrapTestCase
):
def
_make_server_iostream
(
self
,
connection
,
**
kwargs
):
ssl_options
=
dict
(
...
...
tornado/test/locale_test.py
浏览文件 @
06c09038
...
...
@@ -4,6 +4,7 @@ import os
import
tornado.locale
import
unittest
class
TranslationLoaderTest
(
unittest
.
TestCase
):
# TODO: less hacky way to get isolated tests
SAVE_VARS
=
[
'_translations'
,
'_supported_locales'
,
'_use_gettext'
]
...
...
tornado/test/options_test.py
浏览文件 @
06c09038
...
...
@@ -11,6 +11,7 @@ from tornado.escape import utf8
from
tornado.options
import
_Options
,
_LogFormatter
from
tornado.util
import
b
,
bytes_type
@
contextlib
.
contextmanager
def
ignore_bytes_warning
():
if
not
hasattr
(
warnings
,
'catch_warnings'
):
...
...
tornado/test/runtests.py
浏览文件 @
06c09038
...
...
@@ -55,7 +55,7 @@ if __name__ == '__main__':
import
tornado.testing
kwargs
=
{}
if
sys
.
version_info
>=
(
3
,
2
):
if
sys
.
version_info
>=
(
3
,
2
):
# HACK: unittest.main will make its own changes to the warning
# configuration, which may conflict with the settings above
# or command-line flags like -bb. Passing warnings=False
...
...
tornado/test/twisted_test.py
浏览文件 @
06c09038
...
...
@@ -230,6 +230,7 @@ class Writer(object):
if
have_twisted
:
Writer
=
implementer
(
IWriteDescriptor
)(
Writer
)
class
ReactorReaderWriterTest
(
ReactorTestCase
):
def
_set_nonblocking
(
self
,
fd
):
flags
=
fcntl
.
fcntl
(
fd
,
fcntl
.
F_GETFL
)
...
...
tornado/test/wsgi_test.py
浏览文件 @
06c09038
...
...
@@ -73,6 +73,7 @@ class WSGIConnectionTest(HTTPConnectionTest):
def
get_app
(
self
):
return
WSGIContainer
(
validator
(
WSGIApplication
(
self
.
get_handlers
())))
class
WSGIWebTest
(
WSGISafeWebTest
):
def
get_app
(
self
):
self
.
app
=
WSGIApplication
(
self
.
get_handlers
(),
**
self
.
get_app_kwargs
())
...
...
tornado/testing.py
浏览文件 @
06c09038
...
...
@@ -247,7 +247,6 @@ class AsyncHTTPTestCase(AsyncTestCase):
return
HTTPServer
(
self
.
_app
,
io_loop
=
self
.
io_loop
,
**
self
.
get_httpserver_options
())
def
get_app
(
self
):
"""Should be overridden by subclasses to return a
tornado.web.Application or other HTTPServer callback.
...
...
tornado/web.py
浏览文件 @
06c09038
...
...
@@ -1577,7 +1577,7 @@ class StaticFileHandler(RequestHandler):
cache_time
=
self
.
get_cache_time
(
path
,
modified
,
mime_type
)
if
cache_time
>
0
:
self
.
set_header
(
"Expires"
,
datetime
.
datetime
.
utcnow
()
+
\
self
.
set_header
(
"Expires"
,
datetime
.
datetime
.
utcnow
()
+
datetime
.
timedelta
(
seconds
=
cache_time
))
self
.
set_header
(
"Cache-Control"
,
"max-age="
+
str
(
cache_time
))
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录