[gnome-games] tools: Add gameinfo Python module
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] tools: Add gameinfo Python module
- Date: Fri, 19 Aug 2016 21:10:51 +0000 (UTC)
commit b7c27464b68d972903e8339430244aedc6f62dba
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sun Jul 31 00:57:16 2016 +0200
tools: Add gameinfo Python module
This will be used in the next commit to create and handle gameinfo
files.
tools/gameinfo/gameinfo/__init__.py | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/tools/gameinfo/gameinfo/__init__.py b/tools/gameinfo/gameinfo/__init__.py
index 0e6b53a..1402de5 100644
--- a/tools/gameinfo/gameinfo/__init__.py
+++ b/tools/gameinfo/gameinfo/__init__.py
@@ -48,7 +48,7 @@ class Gameinfo:
def findall(self, xpath):
return self.gameinfo.findall(xpath)
- def add_game_discs(self, title, disc_ids, comments=None):
+ def add_game_discs(self, title, disc_ids):
""" Add a set of discs with their own IDs.
"""
# If one of the discs already exists, do nothing.
@@ -60,14 +60,13 @@ class Gameinfo:
game = self._game(title)
discs_node = ET.SubElement(game, 'discs')
- if comments and isinstance(comments, dict):
- for key, value in comments.items():
- discs_node.set(key, value)
for disc_id in disc_ids:
disc_node = ET.SubElement(discs_node, 'disc')
disc_node.set('id', disc_id)
+ return discs_node
+
def _game(self, title):
""" Get a game from its title, create it if it doesn't exist.
"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]