Skip to content

Commit

Permalink
Merge pull request #13 from toabctl/fix-key-errors
Browse files Browse the repository at this point in the history
Fix KeyError for license and summary
  • Loading branch information
saschpe committed Apr 1, 2015
2 parents c1b8074 + 453cd0e commit 030fcef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py2pack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ def generate(args):
data['source_url'] = args.name + '-' + args.version + '.zip'
data['year'] = datetime.datetime.now().year # set current year
data['user_name'] = pwd.getpwuid(os.getuid())[4] # set system user (packager)
data['summary_no_ending_dot'] = re.sub('(.*)\.', '\g<1>', data['summary'])
data['summary_no_ending_dot'] = re.sub('(.*)\.', '\g<1>', data.get('summary', ""))

tarball_file = glob.glob("{0}-{1}.*".format(args.name, args.version)) # we have a local tarball, try to
if tarball_file: # get some more info from that
_augment_data_from_tarball(args, tarball_file[0], data)

if data['license'] in SDPX_LICENSES: # if we have a mapping, transform
if data.get('license', "") in SDPX_LICENSES: # if we have a mapping, transform
data['license'] = SDPX_LICENSES[data['license']] # license into SPDX style

template = env.get_template(args.template)
Expand Down

0 comments on commit 030fcef

Please sign in to comment.