Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
aexus
bypy
提交
ecc0a8f8
B
bypy
项目概览
aexus
/
bypy
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
bypy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ecc0a8f8
编写于
5月 28, 2020
作者:
H
Hou Tianze
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make auth server list dynamic
上级
0419c7f7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
47 addition
and
13 deletion
+47
-13
HISTORY.md
HISTORY.md
+1
-0
HISTORY.rst
HISTORY.rst
+2
-0
bypy/bypy.py
bypy/bypy.py
+18
-0
bypy/const.py
bypy/const.py
+11
-11
bypy/test/configdir/bypy.setting.json
bypy/test/configdir/bypy.setting.json
+1
-1
release.sh
release.sh
+13
-0
update/update.json
update/update.json
+1
-1
未找到文件。
HISTORY.md
浏览文件 @
ecc0a8f8
### Version History:
-
1.6.9: Make auth server list dynamic
-
1.6.8: Fix 1000 items limit for downloading
-
1.6.7: Handle update check network exceptions
-
1.6.6: Let it cry when dies, so we can have some trace
...
...
HISTORY.rst
浏览文件 @
ecc0a8f8
Version History:
~~~~~~~~~~~~~~~~
- 1.6.9: Make auth server list dynamic
- 1.6.8: Fix 1000 items limit for downloading
- 1.6.7: Handle update check network exceptions
...
...
bypy/bypy.py
浏览文件 @
ecc0a8f8
...
...
@@ -981,6 +981,21 @@ Possible fixes:
def
__repr_timeout
(
self
):
return
self
.
__timeout
if
self
.
__timeout
else
'infinite'
def
__update_auth_server_list
(
self
):
try
:
r
=
requests
.
get
(
'https://raw.githubusercontent.com/houtianze/bypy/master/update/auth.json'
)
if
r
.
status_code
==
200
:
try
:
j
=
r
.
json
()
const
.
AuthServerList
=
j
[
'AuthServerList'
]
const
.
RefreshServerList
=
j
[
'RefreshServerList'
]
except
ValueError
:
self
.
pd
(
"Invalid response for auth servers update, skipping."
)
else
:
self
.
pd
(
"HTTP Status {} while updating auth servers, skipping."
.
format
(
r
.
status_code
))
except
:
self
.
pd
(
"Error occurred while updating auth servers, skipping."
)
def
__server_auth
(
self
):
params
=
{
'client_id'
:
self
.
__apikey
,
...
...
@@ -1005,6 +1020,8 @@ Possible fixes:
savedperr
=
perr
if
not
self
.
debug
:
perr
=
nop
self
.
__update_auth_server_list
()
for
auth
in
const
.
AuthServerList
:
(
url
,
retry
,
msg
)
=
auth
pr
(
msg
)
...
...
@@ -1083,6 +1100,7 @@ Possible fixes:
savedperr
=
perr
if
not
self
.
debug
:
perr
=
nop
self
.
__update_auth_server_list
()
for
refresh
in
const
.
RefreshServerList
:
(
url
,
retry
,
msg
)
=
refresh
pr
(
msg
)
...
...
bypy/const.py
浏览文件 @
ecc0a8f8
...
...
@@ -12,7 +12,7 @@ import os
# https://packaging.python.org/single_source_version/
__title__
=
'bypy'
__version__
=
'1.6.
8
'
__version__
=
'1.6.
9
'
__author__
=
'Hou Tianze'
__license__
=
'MIT'
__desc__
=
'Python client for Baidu Yun (Personal Cloud Storage) 百度云/百度网盘 Python 客户端'
...
...
@@ -180,19 +180,19 @@ VercelRedirectUrl = VercelUrl + '/auth'
VercelRefreshUrl
=
VercelUrl
+
'/refresh'
AuthServerList
=
[
# url, retry?, message
(
OpenShiftRedirectUrl
,
False
,
"Authorizing/refreshing with the OpenShift server ..."
),
(
HerokuRedirectUrl
,
False
,
"
OpenShift server failed, authorizing/refresh
ing with the Heroku server ..."
),
(
Heroku1RedirectUrl
,
False
,
"Heroku server failed, authorizing
/refreshing
with the Heroku1 server ..."
),
(
VercelRedirectUrl
,
False
,
"Heroku1 server failed, authorizing
/refreshing
with the Vercel server ..."
),
(
GaeRedirectUrl
,
False
,
"Vercel server failed. Last resort: authorizing
/refreshing
with the GAE server ..."
),
#
(OpenShiftRedirectUrl, False, "Authorizing/refreshing with the OpenShift server ..."),
(
HerokuRedirectUrl
,
False
,
"
Authoriz
ing with the Heroku server ..."
),
(
Heroku1RedirectUrl
,
False
,
"Heroku server failed, authorizing with the Heroku1 server ..."
),
(
VercelRedirectUrl
,
False
,
"Heroku1 server failed, authorizing with the Vercel server ..."
),
(
GaeRedirectUrl
,
False
,
"Vercel server failed. Last resort: authorizing with the GAE server ..."
),
]
RefreshServerList
=
[
# url, retry?, message
(
OpenShiftRefreshUrl
,
False
,
"Authorizing/refreshing with the OpenShift server ..."
),
(
HerokuRefreshUrl
,
False
,
"
OpenShift server failed, authorizing/r
efreshing with the Heroku server ..."
),
(
Heroku1RefreshUrl
,
False
,
"Heroku server failed,
authorizing/
refreshing with the Heroku1 server ..."
),
(
VercelRefreshUrl
,
False
,
"Heroku1 server failed,
authorizing/
refreshing with the Vercel server ..."
),
(
GaeRefreshUrl
,
False
,
"Vercel server failed. Last resort:
authorizing/
refreshing with the GAE server ..."
),
#
(OpenShiftRefreshUrl, False, "Authorizing/refreshing with the OpenShift server ..."),
(
HerokuRefreshUrl
,
False
,
"
R
efreshing with the Heroku server ..."
),
(
Heroku1RefreshUrl
,
False
,
"Heroku server failed, refreshing with the Heroku1 server ..."
),
(
VercelRefreshUrl
,
False
,
"Heroku1 server failed, refreshing with the Vercel server ..."
),
(
GaeRefreshUrl
,
False
,
"Vercel server failed. Last resort: refreshing with the GAE server ..."
),
]
### public static properties
...
...
bypy/test/configdir/bypy.setting.json
浏览文件 @
ecc0a8f8
{
"lastUpdateCheck"
:
15
89986897
,
"lastUpdateCheck"
:
15
90597166
,
"overwriteRemoteTempDir"
:
true
}
\ No newline at end of file
release.sh
浏览文件 @
ecc0a8f8
#!/bin/sh
# !!! RUN THIS SCRIPT UNDER VIRTUALENV !!!
# need to run the following commands before running this release script
# (This is for macOS, and for python virtualenv is recommended)
# --------
...
...
@@ -11,6 +12,17 @@
trap
"echo '=== Release script interrupted ==='; exit -1"
SIGINT
check
()
{
command
-v
"
$1
"
||
{
echo
"'
$1
' doesn't exist, aborting."
;
exit
-1
;
}
}
check git
check python
check pandoc
check pyflakes
check twine
check jq
pycmd
=
python
actual
=
0
...
...
@@ -68,6 +80,7 @@ installtest() {
}
main
()
{
./syncver.sh
eval
$pycmd
genrst.py
parsearg
$*
...
...
update/update.json
浏览文件 @
ecc0a8f8
{
"comment"
:
"Update info"
,
"recommendedVersion"
:
"1.6.
5
"
,
"recommendedVersion"
:
"1.6.
9
"
,
"minimumRequiredVersion"
:
"1.6.0"
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录