pkg = json.load(f)
basename = os.path.basename(json_file)
package_name = os.path.splitext(basename)[0]
- pkg['package'] = package_name
+ pkg['package_name'] = package_name
cb(pkg)
f.close()
def show(pkg):
- print 'Package: ', pkg['package']
+ print 'Package: ', pkg['package_name']
print 'Program: ', pkg['name']
print 'Homepage: ', pkg['homepage']
print
response = urllib2.urlopen(url)
filename = urllib2.unquote(os.path.basename(response.geturl()))
if filename == "":
- sys.stderr.write("Debug (%s): filename: %s url: %s\n" %(pkg['package'], filename, response.geturl()))
+ sys.stderr.write("Debug (%s): filename: %s url: %s\n" %(pkg['package_name'], filename, response.geturl()))
return
destfile = os.path.join(OUTPUT_DIR, filename)
if os.path.exists(destfile):
- sys.stderr.write("Warning (%s): %s exists!\n" % (pkg['package'], destfile))
+ sys.stderr.write("Warning (%s): %s exists!\n" % (pkg['package_name'], destfile))
return
outfile = open(destfile, mode='w')