Skip to content

Commit 9690a36

Browse files
committed
【完善】:删除多余代码并完善提示信息
1 parent f813fc0 commit 9690a36

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

cmds/cmd_package.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -340,44 +340,28 @@ def package_list():
340340
Read the.config file in the BSP directory,
341341
and list the version number of the selected package.
342342
"""
343+
343344
fn = '.config'
344345
env_root = Import('env_root')
345-
# bsp_root = Import('bsp_root')
346-
# target_pkgs_path = os.path.join(bsp_root, 'packages')
347-
# pkgs_fn = os.path.join(target_pkgs_path, 'pkgs.json')
348346

349347
if not os.path.isfile(fn):
350348
print ('No system configuration file : .config.')
351349
print ('You should use < menuconfig > command to config bsp first.')
352350
return
353351

354-
# if not os.path.exists(target_pkgs_path):
355-
# try:
356-
# os.mkdir(target_pkgs_path)
357-
# except:
358-
# print 'mkdir packages directory failed'
359-
# return
360-
361352
pkgs = kconfig.parse(fn)
362353

363-
# if not os.path.isfile(pkgs_fn):
364-
# pkgs_file = file(pkgs_fn, 'w')
365-
# pkgs_file.write(json.dumps(pkgs, indent=1))
366-
# pkgs_file.close()
367-
368354
for pkg in pkgs:
369355
package = Package()
370356
pkg_path = pkg['path']
371357
if pkg_path[0] == '/' or pkg_path[0] == '\\':
372358
pkg_path = pkg_path[1:]
373359

374-
#pkg_path = pkg_path.replace('/', '\\')
375360
pkg_path = os.path.join(env_root, 'packages', pkg_path, 'package.json')
376361
package.parse(pkg_path)
377362

378363
pkgs_name_in_json = package.get_name()
379-
print pkgs_name_in_json, pkg['ver']
380-
# print "package path:", pkg['path']
364+
print ("package name : %s, ver : %s "%(pkgs_name_in_json.encode("utf-8"), pkg['ver'].encode("utf-8")))
381365

382366
if not pkgs:
383367
print ("Packages list is empty.")

package.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ def download(self, ver, path, url_from_srv):
194194
'Accept': '*/*',
195195
'User-Agent': 'curl/7.54.0'}
196196

197-
#print("download from server:" + url_from_srv)
198-
199-
200197
print('Start to download package : %s ' % filename.encode("utf-8"))
201198

202199
while True:

0 commit comments

Comments
 (0)