提交 7bda2434 编写于 作者: H Hou Tianze

Add whoami; Fix isbincache for encrypt_md5

上级 f3e415d1
......@@ -1180,11 +1180,23 @@ Possible fixes:
return self.quota()
def quota(self):
''' Usage: quota/info - displays the quota information '''
''' Usage: quota/info - display the quota information '''
pars = {
'method' : 'info' }
return self.__get(pcsurl + 'quota', pars, self.__quota_act)
def __whoami_act(self, r, args):
j = r.json()
self.jsonq.append(j)
pr('User id: ' + j['userid'])
pr('Username: ' + j['username'])
return const.ENoError
def whoami(self):
''' Usage: whoeami - display the user information '''
pars = {}
return self.__get(const.OpenApiUrl + '/rest/2.0/passport/users/getInfo', pars, self.__whoami_act)
# return:
# 0: local and remote files are of same size
# 1: local file is larger
......
......@@ -168,7 +168,9 @@ class cached(object):
info = entry[file]
if 'md5' in info:
md5 = info['md5']
for c in md5:
# due to encrypt_md5()
# for c in md5:
for c in md5[:9] + md5[10:]:
if not cached.ishexchar(c):
return True
return False
......@@ -300,7 +302,7 @@ def md5(filename, slice = const.OneM):
return encrypt_md5(m.hexdigest())
def encrypt_md5(md5str):
def alidate_md5():
def validate_md5():
if len(md5str) != 32:
return md5str
for i in range(32):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册