/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Jelmer Vernooij
  • Date: 2007-02-03 16:04:46 UTC
  • Revision ID: jelmer@samba.org-20070203160446-r7xksl3qe108vhm3
Add gstatus command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
360
360
 
361
361
register_command(cmd_gcommit)
362
362
 
 
363
class cmd_gstatus(Command):
 
364
    """GTK+ status dialog
 
365
 
 
366
    Graphical user interface for showing status 
 
367
    information."""
 
368
    
 
369
    aliases = [ "gst" ]
 
370
    takes_args = ['PATH?']
 
371
    takes_options = []
 
372
 
 
373
    def run(self, path='.'):
 
374
        import os
 
375
        pygtk = import_pygtk()
 
376
 
 
377
        try:
 
378
            import gtk
 
379
        except RuntimeError, e:
 
380
            if str(e) == "could not open display":
 
381
                raise NoDisplayError
 
382
 
 
383
        set_ui_factory()
 
384
        from status import StatusDialog
 
385
        (wt, wt_path) = WorkingTree.open_containing(path)
 
386
        status = StatusDialog(wt, wt_path)
 
387
        status.connect("destroy", gtk.main_quit)
 
388
        status.run()
 
389
 
 
390
register_command(cmd_gstatus)
 
391
 
 
392
 
363
393
import gettext
364
394
gettext.install('olive-gtk')
365
395