yaml rewrite version code as int

This commit is contained in:
Michael Pöhn 2017-05-02 14:13:30 +02:00
parent f9d4007ea6
commit 7aa92abebc
3 changed files with 145 additions and 140 deletions

View file

@ -970,7 +970,10 @@ def write_yaml(mf, app):
b = ruamel.yaml.comments.CommentedMap()
for field in fields:
if hasattr(build, field) and getattr(build, field):
b.update({field: getattr(build, field)})
if field is 'versionCode':
b.update({field: int(getattr(build, field))})
else:
b.update({field: getattr(build, field)})
builds.append(b)
# insert extra empty lines between builds
@ -1029,7 +1032,9 @@ def write_yaml(mf, app):
if field in ['Description']:
preformated.update({field: ruamel.yaml.scalarstring.preserve_literal(getattr(app, field))})
elif field is 'Builds':
preformated.update({'Builds': _builds_to_yaml(app)})
preformated.update({field: _builds_to_yaml(app)})
elif field is 'CurrentVersionCode':
preformated.update({field: int(getattr(app, field))})
else:
preformated.update({field: getattr(app, field)})