Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冰.封万里
flask
提交
8ab49677
F
flask
项目概览
冰.封万里
/
flask
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flask
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
8ab49677
编写于
4月 15, 2021
作者:
D
David Lord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
consistent versions and deprecation messages
上级
16f51ef7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
23 deletion
+26
-23
src/flask/cli.py
src/flask/cli.py
+3
-2
src/flask/helpers.py
src/flask/helpers.py
+9
-8
src/flask/json/__init__.py
src/flask/json/__init__.py
+13
-12
src/flask/scaffold.py
src/flask/scaffold.py
+1
-1
未找到文件。
src/flask/cli.py
浏览文件 @
8ab49677
...
...
@@ -98,7 +98,7 @@ def call_factory(script_info, app_factory, args=None, kwargs=None):
if
"script_info"
in
sig
.
parameters
:
warnings
.
warn
(
"The 'script_info' argument is deprecated and will not be"
" passed to the app factory function in 2.1."
,
" passed to the app factory function in
Flask
2.1."
,
DeprecationWarning
,
)
kwargs
[
"script_info"
]
=
script_info
...
...
@@ -110,7 +110,8 @@ def call_factory(script_info, app_factory, args=None, kwargs=None):
):
warnings
.
warn
(
"Script info is deprecated and will not be passed as the"
" single argument to the app factory function in 2.1."
,
" single argument to the app factory function in Flask"
" 2.1."
,
DeprecationWarning
,
)
args
.
append
(
script_info
)
...
...
src/flask/helpers.py
浏览文件 @
8ab49677
...
...
@@ -446,8 +446,9 @@ def _prepare_send_file_kwargs(
):
if
attachment_filename
is
not
None
:
warnings
.
warn
(
"The 'attachment_filename' parameter has been renamed to 'download_name'."
" The old name will be removed in Flask 2.1."
,
"The 'attachment_filename' parameter has been renamed to"
" 'download_name'. The old name will be removed in Flask"
" 2.1."
,
DeprecationWarning
,
stacklevel
=
3
,
)
...
...
@@ -455,8 +456,8 @@ def _prepare_send_file_kwargs(
if
cache_timeout
is
not
None
:
warnings
.
warn
(
"The 'cache_timeout' parameter has been renamed to
'max_age'. The old name
"
" will be removed in Flask 2.1."
,
"The 'cache_timeout' parameter has been renamed to"
"
'max_age'. The old name
will be removed in Flask 2.1."
,
DeprecationWarning
,
stacklevel
=
3
,
)
...
...
@@ -464,8 +465,8 @@ def _prepare_send_file_kwargs(
if
add_etags
is
not
None
:
warnings
.
warn
(
"The 'add_etags' parameter has been renamed to 'etag'. The
old name will be
"
" removed in Flask 2.1."
,
"The 'add_etags' parameter has been renamed to 'etag'. The"
"
old name will be
removed in Flask 2.1."
,
DeprecationWarning
,
stacklevel
=
3
,
)
...
...
@@ -549,7 +550,7 @@ def send_file(
``conditional`` is enabled and ``max_age`` is not set by
default.
.. versionchanged:: 2.0
.0
.. versionchanged:: 2.0
``etag`` replaces the ``add_etags`` parameter. It can be a
string to use instead of generating one.
...
...
@@ -629,7 +630,7 @@ def safe_join(directory, *pathnames):
"""
warnings
.
warn
(
"'flask.helpers.safe_join' is deprecated and will be removed in"
" 2.1. Use 'werkzeug.utils.safe_join' instead."
,
"
Flask
2.1. Use 'werkzeug.utils.safe_join' instead."
,
DeprecationWarning
,
stacklevel
=
2
,
)
...
...
src/flask/json/__init__.py
浏览文件 @
8ab49677
...
...
@@ -103,7 +103,7 @@ def dumps(obj, app=None, **kwargs):
:param kwargs: Extra arguments passed to :func:`json.dumps`.
.. versionchanged:: 2.0
``encoding`` is deprecated and will be removed in 2.1.
``encoding`` is deprecated and will be removed in
Flask
2.1.
.. versionchanged:: 1.0.3
``app`` can be passed directly, rather than requiring an app
...
...
@@ -115,7 +115,7 @@ def dumps(obj, app=None, **kwargs):
if
encoding
is
not
None
:
warnings
.
warn
(
"'encoding' is deprecated and will be removed in 2.1."
,
"'encoding' is deprecated and will be removed in
Flask
2.1."
,
DeprecationWarning
,
stacklevel
=
2
,
)
...
...
@@ -140,7 +140,7 @@ def dump(obj, fp, app=None, **kwargs):
.. versionchanged:: 2.0
Writing to a binary file, and the ``encoding`` argument, is
deprecated and will be removed in 2.1.
deprecated and will be removed in
Flask
2.1.
"""
_dump_arg_defaults
(
kwargs
,
app
=
app
)
encoding
=
kwargs
.
pop
(
"encoding"
,
None
)
...
...
@@ -155,7 +155,7 @@ def dump(obj, fp, app=None, **kwargs):
if
show_warning
:
warnings
.
warn
(
"Writing to a binary file, and the 'encoding' argument, is"
" deprecated and will be removed in 2.1."
,
" deprecated and will be removed in
Flask
2.1."
,
DeprecationWarning
,
stacklevel
=
2
,
)
...
...
@@ -175,8 +175,8 @@ def loads(s, app=None, **kwargs):
:param kwargs: Extra arguments passed to :func:`json.loads`.
.. versionchanged:: 2.0
``encoding`` is deprecated and will be removed in
2.1. The data
must be a string or UTF-8 bytes.
``encoding`` is deprecated and will be removed in
Flask 2.1. The
data
must be a string or UTF-8 bytes.
.. versionchanged:: 1.0.3
``app`` can be passed directly, rather than requiring an app
...
...
@@ -187,8 +187,8 @@ def loads(s, app=None, **kwargs):
if
encoding
is
not
None
:
warnings
.
warn
(
"'encoding' is deprecated and will be removed in
2.1. The
"
" data must be a string or UTF-8 bytes."
,
"'encoding' is deprecated and will be removed in
Flask 2.1.
"
"
The
data must be a string or UTF-8 bytes."
,
DeprecationWarning
,
stacklevel
=
2
,
)
...
...
@@ -211,16 +211,17 @@ def load(fp, app=None, **kwargs):
:param kwargs: Extra arguments passed to :func:`json.load`.
.. versionchanged:: 2.0
``encoding`` is deprecated and will be removed in
2.1. The fil
e
must be text mode, or binary mode with UTF-8 bytes.
``encoding`` is deprecated and will be removed in
Flask 2.1. Th
e
file
must be text mode, or binary mode with UTF-8 bytes.
"""
_load_arg_defaults
(
kwargs
,
app
=
app
)
encoding
=
kwargs
.
pop
(
"encoding"
,
None
)
if
encoding
is
not
None
:
warnings
.
warn
(
"'encoding' is deprecated and will be removed in 2.1. The"
" file must be text mode, or binary mode with UTF-8 bytes."
,
"'encoding' is deprecated and will be removed in Flask 2.1."
" The file must be text mode, or binary mode with UTF-8"
" bytes."
,
DeprecationWarning
,
stacklevel
=
2
,
)
...
...
src/flask/scaffold.py
浏览文件 @
8ab49677
...
...
@@ -56,7 +56,7 @@ class Scaffold:
are relative to. Typically not set, it is discovered based on
the ``import_name``.
.. versionadded:: 2.0
.0
.. versionadded:: 2.0
"""
name
:
str
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录