Rev 513: Show the credits of those who contributed in the About dialog. in file:///data/jelmer/bzr-gtk/credits/

Jelmer Vernooij jelmer at samba.org
Sat Jun 28 21:25:39 BST 2008


At file:///data/jelmer/bzr-gtk/credits/

------------------------------------------------------------
revno: 513
revision-id: jelmer at samba.org-20080628202416-pvt4hkck3gqndine
parent: jelmer at samba.org-20080628171346-ob42iggcc663s4xz
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: credits
timestamp: Sat 2008-06-28 22:24:16 +0200
message:
  Show the credits of those who contributed in the About dialog.
  
  The credits are loaded from a pickle file that is generated by 
  a new script, which uses the stats plugin to do the heavy lifting.
added:
  create-credits.py              createcredits.py-20080628172336-qahz7ofx9b7ymjx5-1
modified:
  .bzrignore                     bzrignore-20060929115259-l3024hqm4xkyl444-1
  about.py                       about.py-20070715145104-2ihlkw9xgrwj7i3d-1
=== modified file '.bzrignore'
--- a/.bzrignore	2007-09-02 15:42:18 +0000
+++ b/.bzrignore	2008-06-28 20:24:16 +0000
@@ -10,3 +10,4 @@
 bzr-gtk.trunk-matkor.e3p
 bzr-gtk.trunk-matkor.e3s
 bzr-gtk.trunk-matkor.e3t
+credits.pickle

=== modified file 'about.py'
--- a/about.py	2008-06-28 17:13:46 +0000
+++ b/about.py	2008-06-28 20:24:16 +0000
@@ -23,6 +23,10 @@
 import bzrlib
 import gtk
 import os
+from bzrlib.branch import Branch
+from bzrlib.errors import NotBranchError, NoRepositoryPresent
+from bzrlib.trace import mutter
+
 from bzrlib.plugins.gtk import icon_path
 
 
@@ -34,6 +38,15 @@
     return "GPLv2 or later"
 
 
+def load_credits():
+    import pickle
+    try:
+        credits = pickle.load(file("credits.pickle"))
+    except IOError:
+        credits = None
+    return credits
+
+
 class AboutDialog(gtk.AboutDialog):
     def __init__(self):
         super(AboutDialog, self).__init__()
@@ -42,6 +55,13 @@
         self.set_website("http://bazaar-vcs.org/BzrGtk")
         self.set_license(read_license())
         self.set_logo(gtk.gdk.pixbuf_new_from_file(icon_path("bzr-icon-64.png")))
+        credits = load_credits()
+        if credits is not None:
+            (authors, documenters, artists, translators) = credits
+            self.set_authors(authors)
+            self.set_documenters(documenters)
+            self.set_artists(artists)
+            self.set_translator_credits("\n".join(translators))
         self.connect ("response", lambda d, r: d.destroy())
 
 

=== added file 'create-credits.py'
--- a/create-credits.py	1970-01-01 00:00:00 +0000
+++ b/create-credits.py	2008-06-28 20:24:16 +0000
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+# Copyright (C) 2008 Jelmer Vernooij <jelmer at samba.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+from bzrlib.branch import Branch
+from bzrlib.plugins.stats import find_credits
+
+import pickle
+
+branch = Branch.open(".")
+credits = find_credits(branch.repository, branch.last_revision())
+
+pickle.dump(credits, file("credits.pickle", 'w'))




More information about the bazaar-commits mailing list