提交 52af6fd7 编写于 作者: H Hou Tianze

Fix #446 which is caused by wrong initilization sequences

上级 da6e1e0f
### Version History:
- 1.6.4: Fix `--move` argument causing exception
- 1.6.3: Change default timeout to 5 minutes
- 1.6.2: Properly handle (treat it as no error) error_code 31061 (file already exists) from PCS
- 1.6.1: Ensure cache loading/saving failures won't affect normal operations; Fix the bug that clean up code not called on exit
......
Version History:
~~~~~~~~~~~~~~~~
- 1.6.4: Fix ``--move`` argument causing exception
- 1.6.3: Change default timeout to 5 minutes
- 1.6.2: Properly handle (treat it as no error) error_code 31061 (file
already exists) from PCS
......
......@@ -310,10 +310,16 @@ class ByPy(object):
downloader_args = "",
processes = const.DefaultProcessCount,
secretkey = const.SecretKey):
super(ByPy, self).__init__()
self.jsonq = deque(maxlen = 64)
# these two variables are without leading double underscore "__" as to export the as public,
# so if any code using this class can check the current verbose / debug level
cached.verbose = self.verbose = verbose
cached.debug = self.debug = debug
if not cached.usecache:
pinfo("Forced hash recalculation, hash cache won't be used")
# declaration of myself
global gbypyinst
gbypyinst = self
......@@ -377,13 +383,6 @@ class ByPy(object):
self.__verify = True
self.processes = processes
# these two variables are without leadning double underscaore "__" as to export the as public,
# so if any code using this class can check the current verbose / debug level
cached.verbose = self.verbose = verbose
cached.debug = self.debug = debug
if not cached.usecache:
pinfo("Forced hash recaculation, hash cache won't be used")
#TODO: SSL verification causes some much trouble for different Python version
# I give up and disable it for good, or for bad
checkssl = False
......@@ -514,7 +513,7 @@ class ByPy(object):
pr(msg)
def pd(self, msg, level = 1, **kwargs):
if self.debug >= level:
if self.debug and self.debug >= level:
pdbg(msg, kwargs)
def shalloverwrite(self, prompt):
......@@ -1146,7 +1145,7 @@ Possible fixes:
def __remove_local_on_success(self, localpath):
if self.__deletesource:
self.pd("Removing local path '{}' after successful upload.".format(localpath))
result = cachedm.remove_path_and_cache(localpath)
result = cached.remove_path_and_cache(localpath)
if result == const.ENoError:
self.pd("Local path '{}' removed.".format(localpath))
else:
......
......@@ -12,7 +12,7 @@ import os
# https://packaging.python.org/single_source_version/
__title__ = 'bypy'
__version__ = '1.6.3'
__version__ = '1.6.4'
__author__ = 'Hou Tianze'
__license__ = 'MIT'
__desc__ = 'Python client for Baidu Yun (Personal Cloud Storage) 百度云/百度网盘 Python 客户端'
......@@ -176,14 +176,14 @@ HerokuRefreshUrl = HerokuUrl + '/refresh'
Heroku1RedirectUrl = Heroku1Url + '/auth'
Heroku1RefreshUrl = Heroku1Url + '/refresh'
AuthServerList = [
# url, rety?, message
# url, retry?, message
(OpenShiftRedirectUrl, False, "Authorizing/refreshing with the OpenShift server ..."),
(HerokuRedirectUrl, False, "OpenShift server failed, authorizing/refreshing with the Heroku server ..."),
(Heroku1RedirectUrl, False, "Heroku server failed, authorizing/refreshing with the Heroku1 server ..."),
(GaeRedirectUrl, False, "Heroku1 server failed. Last resort: authorizing/refreshing with the GAE server ..."),
]
RefreshServerList = [
# url, rety?, message
# url, retry?, message
(OpenShiftRefreshUrl, False, "Authorizing/refreshing with the OpenShift server ..."),
(HerokuRefreshUrl, False, "OpenShift server failed, authorizing/refreshing with the Heroku server ..."),
(Heroku1RefreshUrl, False, "Heroku server failed, authorizing/refreshing with the Heroku1 server ..."),
......
{
"comment": "Update info",
"recommendedVersion": "1.6.3",
"recommendedVersion": "1.6.4",
"minimumRequiredVersion": "1.6.0"
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册