mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
yaml rewrite version code as int
This commit is contained in:
parent
f9d4007ea6
commit
7aa92abebc
3 changed files with 145 additions and 140 deletions
|
|
@ -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)})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue