mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-02 09:10:11 +02:00
metadata: fix pyflakes "use ==/!= to compare str, bytes, and int literals"
$ ./hooks/pre-commit || export EXITVALUE=1 WARNING: ruby is not installed, using dummy placeholder! fdroidserver/metadata.py:1180: use ==/!= to compare str, bytes, and int literals fdroidserver/metadata.py:1184: use ==/!= to compare str, bytes, and int literals fdroidserver/metadata.py:1186: use ==/!= to compare str, bytes, and int literals fdroidserver/metadata.py:1189: use ==/!= to compare str, bytes, and int literals ERROR: pyflakes tests failed!
This commit is contained in:
parent
7d8fbd3126
commit
217e6a7c30
@ -1177,16 +1177,16 @@ def write_yaml(mf, app):
|
|||||||
cm = ruamel.yaml.comments.CommentedMap()
|
cm = ruamel.yaml.comments.CommentedMap()
|
||||||
insert_newline = False
|
insert_newline = False
|
||||||
for field in yaml_app_field_order:
|
for field in yaml_app_field_order:
|
||||||
if field is '\n':
|
if field == '\n':
|
||||||
# next iteration will need to insert a newline
|
# next iteration will need to insert a newline
|
||||||
insert_newline = True
|
insert_newline = True
|
||||||
else:
|
else:
|
||||||
if app.get(field) or field is 'Builds':
|
if app.get(field) or field == 'Builds':
|
||||||
# .txt calls it 'builds' internally, everywhere else its 'Builds'
|
# .txt calls it 'builds' internally, everywhere else its 'Builds'
|
||||||
if field is 'Builds':
|
if field == 'Builds':
|
||||||
if app.get('builds'):
|
if app.get('builds'):
|
||||||
cm.update({field: _builds_to_yaml(app)})
|
cm.update({field: _builds_to_yaml(app)})
|
||||||
elif field is 'CurrentVersionCode':
|
elif field == 'CurrentVersionCode':
|
||||||
cm.update({field: _field_to_yaml(TYPE_INT, getattr(app, field))})
|
cm.update({field: _field_to_yaml(TYPE_INT, getattr(app, field))})
|
||||||
else:
|
else:
|
||||||
cm.update({field: _field_to_yaml(fieldtype(field), getattr(app, field))})
|
cm.update({field: _field_to_yaml(fieldtype(field), getattr(app, field))})
|
||||||
|
Loading…
Reference in New Issue
Block a user