[Pkg-bazaar-commits] ./bzr-gtk/unstable r608: Merge create-credits into setup.py.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:44:27 UTC 2009


------------------------------------------------------------
revno: 608
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Tue 2008-10-14 20:38:54 +0200
message:
  Merge create-credits into setup.py.
removed:
  create-credits.py
modified:
  setup.py
-------------- next part --------------
=== removed file 'create-credits.py'
--- a/create-credits.py	2008-06-28 20:24:16 +0000
+++ b/create-credits.py	1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
-#!/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'))

=== modified file 'setup.py'
--- a/setup.py	2008-10-14 16:02:28 +0000
+++ b/setup.py	2008-10-14 18:38:54 +0000
@@ -1,8 +1,10 @@
 #!/usr/bin/python
+
 """GTK+ Frontends for various Bazaar commands."""
 
 from distutils.core import setup, Command
 from distutils.command.install_data import install_data
+from distutils.command.build import build
 from distutils.dep_util import newer
 from distutils.log import info
 import glob
@@ -33,6 +35,40 @@
         result = runner.run(suite)
         return result.wasSuccessful()
 
+
+class CreateCredits(Command):
+    description = "Create credits file"
+
+    user_options = []
+
+    def initialize_options(self):
+        pass
+
+    def finalize_options(self):
+        pass
+
+    def get_command_name(self):
+        return 'test'
+
+    def run(self):
+        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'))
+        return True
+
+
+class BuildData(build):
+    def run(self):
+
+        return build.run(self)
+
+
 class InstallData(install_data):
     def run(self):
         self.data_files.extend(self._compile_po_files())
@@ -96,8 +132,7 @@
     maintainer_email = "jelmer at samba.org",
     description = "GTK+ Frontends for various Bazaar commands",
     license = "GNU GPL v2 or later",
-    scripts=['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
-    homepage = "http://bazaar-vcs.org/BzrGtk",
+    scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
     package_dir = {
         "bzrlib.plugins.gtk": ".",
         "bzrlib.plugins.gtk.viz": "viz", 
@@ -153,5 +188,6 @@
                         'icons/emblem-bzr-removed.svg'])
                ],
     cmdclass={'install_data': InstallData,
+              'build_credits': CreateCredits,
               'check': Check}
 )



More information about the Pkg-bazaar-commits mailing list