chiark / gitweb /
rewritemeta: fix proper_format() so lint works with .yml files
authorHans-Christoph Steiner <hans@eds.org>
Fri, 23 Feb 2018 21:42:46 +0000 (22:42 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Fri, 23 Feb 2018 21:43:03 +0000 (22:43 +0100)
fdroidserver/rewritemeta.py

index ed941bd7b289102cea98b7abf81e033d5fca5818..b731a872574e9ed0e19d5bead1975969ce370d41 100644 (file)
@@ -36,7 +36,11 @@ def proper_format(app):
     # read in metadata.py
     with open(app.metadatapath, 'r', encoding='utf8') as f:
         cur_content = f.read()
-    metadata.write_txt(s, app)
+    _ignored, extension = common.get_extension(app.metadatapath)
+    if extension == 'yml':
+        metadata.write_yaml(s, app)
+    elif extension == 'txt':
+        metadata.write_txt(s, app)
     content = s.getvalue()
     s.close()
     return content == cur_content