From: Antonio Ospite Date: Sat, 26 Nov 2011 11:49:37 +0000 (+0100) Subject: winfreed.py: rename 'package' field to 'package_name' X-Git-Url: https://git.ao2.it/winfreed.git/commitdiff_plain/a6c66f6a94b075096cf2c8d50ba1ae64d5be48e5?ds=sidebyside winfreed.py: rename 'package' field to 'package_name' --- diff --git a/winfreed.py b/winfreed.py index 370caff..f4596b6 100755 --- a/winfreed.py +++ b/winfreed.py @@ -39,12 +39,12 @@ def process_all(path, cb): 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 @@ -60,12 +60,12 @@ def download(pkg): 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')