- with open(json_file, mode='r') as f:
- entry = json.load(f)
- basename = os.path.basename(json_file)
- package_name = os.path.splitext(basename)[0]
- entry['package'] = package_name
- cb(entry)
- f.close()
-
-def show(entry):
- print 'Package: ', entry['package']
- print 'Program: ', entry['name']
- print 'Homepage: ', entry['homepage']
+ pkg = get_pkg(json_file)
+ if not pkg:
+ sys.stderr.write("Error: cannot get a pkg for: %s\n" % json_file)
+ continue
+ cb(pkg)
+
+
+def show(pkg):
+ print 'Package: ', pkg['package_name']
+ print 'Program: ', pkg['name']
+ print 'Homepage: ', pkg['homepage']