summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2009-03-26 15:57:44 +0000
committerVincent Untz <vuntz@src.gnome.org>2009-03-26 15:57:44 +0000
commit90514c0a1903890d2b8f1e890e6b0831c948cbd0 (patch)
tree2b905140fae2344fbd32a3ab4058d28531308629
parent25b82e76eb477ac73213446411712584e9621724 (diff)
downloadgnome-desktop-90514c0a1903890d2b8f1e890e6b0831c948cbd0.tar.gz
make the code returning the content of gnome-version.xml a bit more solid,
2009-03-26 Vincent Untz <vuntz@gnome.org> * gnome-about/gnome-about.in: make the code returning the content of gnome-version.xml a bit more solid, so that we can handle a file that doesn't contain the date, the distributor or the version. svn path=/trunk/; revision=5454
-rw-r--r--ChangeLog6
-rw-r--r--gnome-about/gnome-about.in22
2 files changed, 21 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c2cc090..a07b094a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-26 Vincent Untz <vuntz@gnome.org>
+
+ * gnome-about/gnome-about.in: make the code returning the content of
+ gnome-version.xml a bit more solid, so that we can handle a file
+ that doesn't contain the date, the distributor or the version.
+
2009-03-16 Vincent Untz <vuntz@gnome.org>
* configure.in: post-release bump to 2.26.1
diff --git a/gnome-about/gnome-about.in b/gnome-about/gnome-about.in
index ec07029c..dbc07558 100644
--- a/gnome-about/gnome-about.in
+++ b/gnome-about/gnome-about.in
@@ -86,7 +86,7 @@ def cleanup_date (date):
# FIXME: we don't have g_locale_to_utf8 in python. See bug #530382
return unicode (time.strftime ("%x", time.strptime (date, "%Y-%m-%d")), locale.getpreferredencoding ()).encode ("utf-8")
except:
- return False
+ return ""
# Imported from GNOME's Sabayon
# (sabayon/admin-tool/lockdown/disabledapplets.py)
@@ -965,7 +965,9 @@ contributors list) correctly positionned and sized.'''
self.load_description_messages (node)
'''Format version'''
- if not len (infos["minor"]):
+ if not len (infos["platform"]):
+ version = ""
+ elif not len (infos["minor"]):
version = infos["platform"]
elif not len (infos["micro"]):
version = "%s.%s" % (infos["platform"], infos["minor"])
@@ -973,11 +975,17 @@ contributors list) correctly positionned and sized.'''
version = "%s.%s.%s" % (infos["platform"], infos["minor"],
infos["micro"])
- return [
- (_("Version"), version),
- (_("Distributor"), infos["distributor"]),
- (_("Build Date"), cleanup_date (infos["date"]))
- ]
+ date = cleanup_date (infos["date"])
+
+ retval = []
+ if version:
+ retval.append((_("Version"), version))
+ if infos["distributor"]:
+ retval.append((_("Distributor"), infos["distributor"]))
+ if date:
+ retval.append((_("Build Date"), date))
+
+ return retval
def load_description_messages (self, node):
'''Find the best translation of each description message'''