[Pkg-bazaar-commits] ./bzr-gtk/unstable r177: Register commands all at once.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:45:36 UTC 2009


------------------------------------------------------------
revno: 177
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Tue 2007-03-20 21:47:09 +0100
message:
  Register commands all at once.
modified:
  __init__.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2007-03-20 19:36:35 +0000
+++ b/__init__.py	2007-03-20 20:47:09 +0000
@@ -67,9 +67,7 @@
 
 from bzrlib.commands import Command, register_command, display_command
 from bzrlib.errors import NotVersionedError, BzrCommandError, NoSuchFile
-from bzrlib.commands import Command, register_command
 from bzrlib.option import Option
-from bzrlib.bzrdir import BzrDir
 
 import os.path
 
@@ -83,7 +81,7 @@
 
 
 def set_ui_factory():
-    pygtk = import_pygtk()
+    import_pygtk()
     from ui import GtkUIFactory
     import bzrlib.ui
     bzrlib.ui.ui_factory = GtkUIFactory()
@@ -108,8 +106,6 @@
         dialog = BranchDialog(os.path.abspath('.'))
         dialog.run()
 
-register_command(cmd_gbranch)
-
 class cmd_gcheckout(Command):
     """ GTK+ checkout.
     
@@ -129,7 +125,6 @@
         dialog = CheckoutDialog(os.path.abspath('.'))
         dialog.run()
 
-register_command(cmd_gcheckout)
 
 class cmd_gpush(Command):
     """ GTK+ push.
@@ -153,7 +148,6 @@
         dialog = PushDialog(br)
         dialog.run()
 
-register_command(cmd_gpush)
 
 class cmd_gdiff(Command):
     """Show differences in working tree in a GTK+ Window.
@@ -205,7 +199,6 @@
         finally:
             wt.unlock()
 
-register_command(cmd_gdiff)
 
 class cmd_visualise(Command):
     """Graphically visualise this branch.
@@ -249,8 +242,6 @@
             br.unlock()
 
 
-register_command(cmd_visualise)
-
 class cmd_gannotate(Command):
     """GTK+ annotate.
     
@@ -285,6 +276,7 @@
 
         from annotate.gannotate import GAnnotateWindow
         from annotate.config import GAnnotateConfig
+        from bzrlib.bzrdir import BzrDir
 
         wt, br, path = BzrDir.open_containing_tree_or_branch(filename)
         if wt is not None:
@@ -321,7 +313,6 @@
             if wt is not None:
                 wt.unlock()
 
-register_command(cmd_gannotate)
 
 class cmd_gcommit(Command):
     """GTK+ commit dialog
@@ -370,7 +361,6 @@
         commit = CommitDialog(wt, path, not br)
         commit.run()
 
-register_command(cmd_gcommit)
 
 class cmd_gstatus(Command):
     """GTK+ status dialog
@@ -399,7 +389,6 @@
         status.connect("destroy", gtk.main_quit)
         status.run()
 
-register_command(cmd_gstatus)
 
 class cmd_gconflicts(Command):
     """ GTK+ push.
@@ -421,7 +410,6 @@
         dialog = ConflictsDialog(wt)
         dialog.run()
 
-register_command(cmd_gconflicts)
 
 class cmd_gpreferences(Command):
     """ GTK+ preferences dialog.
@@ -441,7 +429,6 @@
         dialog = PreferencesWindow()
         dialog.run()
 
-register_command(cmd_gpreferences)
 
 
 class cmd_gmissing(Command):
@@ -479,7 +466,23 @@
         finally:
             local_branch.unlock()
 
-register_command(cmd_gmissing)
+
+commands = [
+    cmd_gmissing, 
+    cmd_gpreferences, 
+    cmd_gconflicts, 
+    cmd_gstatus,
+    cmd_gcommit, 
+    cmd_gannotate, 
+    cmd_visualise, 
+    cmd_gdiff,
+    cmd_gpush, 
+    cmd_gcheckout, 
+    cmd_gbranch 
+    ]
+
+for cmd in commands:
+    register_command(cmd)
 
 import gettext
 gettext.install('olive-gtk')



More information about the Pkg-bazaar-commits mailing list