[gnome-games] tools: Add gameinfo/sort.py



commit 1cd03f7c7d3c978fd91b6755a4d0f465a73caaec
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Aug 31 17:55:17 2016 +0200

    tools: Add gameinfo/sort.py
    
    Allow to sort Gameinfo documents.
    
    This helps sorting existing Gameinfo documents before updating them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770192

 tools/gameinfo/sort.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/tools/gameinfo/sort.py b/tools/gameinfo/sort.py
new file mode 100755
index 0000000..7decbb6
--- /dev/null
+++ b/tools/gameinfo/sort.py
@@ -0,0 +1,10 @@
+#!/bin/env python3
+
+from gameinfo import Gameinfo
+from sys import argv
+
+if __name__ == '__main__':
+    if len(argv) > 1:
+        for gameinfo_path in argv[1:]:
+            gameinfo = Gameinfo(gameinfo_path)
+            gameinfo.save(gameinfo_path)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]