|
From: Thiago B. A. <bo...@us...> - 2009-12-05 03:47:55
|
This is an automated email from the git, the tree hashes are:
via 3c755341cf0e4954446a76354859803b4bfb79bc (commit)
from cd33742d2bc5a80d68ddbfd74f38a3b9f94fc814 (commit)
- Log -----------------------------------------------------------------
commit 3c755341cf0e4954446a76354859803b4bfb79bc
Author: Thiago Borges Abdnur <bo...@gm...>
Date: Sat Dec 5 01:47:19 2009 -0200
Adding tags correct parsing
diff --git a/code/hud.py b/code/hud.py
index 67ac485..6947d7b 100644
--- a/code/hud.py
+++ b/code/hud.py
@@ -2,10 +2,11 @@
# -*- coding: utf-8 -*-
#----------------------------------------------------------------------
-# Author:
+# Authors:
# Bruno Dilly <bru...@br...>
+# Thiago Borges Abdnur <bo...@gm...>
#
-# Copyright (C) 2009 Bruno Dilly
+# Copyright (C) 2009 Bruno Dilly and Thiago Borges Abdnur
#
# Released under GNU GPL, read the file 'COPYING' for more information
# ----------------------------------------------------------------------
@@ -76,8 +77,28 @@ class HUD:
info = self.track_info
fcolor = (255, 255, 255)
- text0 = "%s by %s" % (info['title'][0], info['artist'][0])
- text1 = "%s (%s)" % (info['album'][0], info['date'][0])
+ if info.has_key('title'):
+ title = info['title'][0]
+ else:
+ title = "Unknown title"
+
+ if info.has_key('artist'):
+ artist = info['artist'][0]
+ else:
+ artist = "Unknown artist"
+
+ if info.has_key('album'):
+ album = info['album'][0]
+ else:
+ album = "Unknown album"
+
+ if info.has_key('date'):
+ date = "(%s)" % info['date'][0]
+ else:
+ date = ""
+
+ text0 = "%s by %s" % (title, artist)
+ text1 = "%s %s" % (album, date)Thiago Borges Abdnur <bo...@gm...>
# print "Rendering track info: %s" % text
self.font.set_bold(True)
image_track_ln0 = self.font.render(text0, True, fcolor)
-----------------------------------------------------------------------
Summary of changes:
code/hud.py | 29 +++++++++++++++++++++++++----
1 files changed, 25 insertions(+), 4 deletions(-)
--
Dead Channel is a sci-fi shoot 'em up game developed using pygame.
|