提交 c97d4e00 编写于 作者: W wangxiao

update _downloader.py

上级 ed98d18f
...@@ -131,15 +131,13 @@ def _convert(path, silent=False): ...@@ -131,15 +131,13 @@ def _convert(path, silent=False):
def download(item, scope='all', path='.'): def download(item, scope='all', path='.'):
item = item.lower() item = item.lower()
scope = scope.lower() scope = scope.lower()
print('1111111111111')
assert item in _items, '{} is not found. Support list: {}'.format(item, list(_items.keys())) assert item in _items, '{} is not found. Support list: {}'.format(item, list(_items.keys()))
if _items[item]['utils'] is not None: if _items[item]['utils'] is not None:
_download(item, 'utils', path, silent=True) _download(item, 'utils', path, silent=True)
if scope != 'all': if scope != 'all':
print('222222') assert scope in _items[item], '{} is not found. Support scopes: {}'.format(scope, list(_items[item].keys()))
# assert scope in _items[item], '{} is not found. Support scopes: {}'.format(scope, list(_items[item].keys()))
_download(item, scope, path) _download(item, scope, path)
else: else:
for s in _items[item].keys(): for s in _items[item].keys():
...@@ -148,7 +146,6 @@ def download(item, scope='all', path='.'): ...@@ -148,7 +146,6 @@ def download(item, scope='all', path='.'):
def _ls(item, scope, l = 10): def _ls(item, scope, l = 10):
if scope != 'all': if scope != 'all':
print('33333')
assert scope in _items[item], '{} is not found. Support scopes: {}'.format(scope, list(_items[item].keys())) assert scope in _items[item], '{} is not found. Support scopes: {}'.format(scope, list(_items[item].keys()))
print ('{} ==> {}'.format(item, scope)) print ('{} ==> {}'.format(item, scope))
else: else:
...@@ -163,7 +160,6 @@ def ls(item='all', scope='all'): ...@@ -163,7 +160,6 @@ def ls(item='all', scope='all'):
return return
print ('Download list:') print ('Download list:')
if item != 'all': if item != 'all':
print('44444')
assert item in _items, '{} is not found. Support scopes: {}'.format(item, list(_items.keys())) assert item in _items, '{} is not found. Support scopes: {}'.format(item, list(_items.keys()))
_ls(item, scope) _ls(item, scope)
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册