Merge lp://qastaging/~andrea.corbellini/bzr-gedit/check-bzr-gtk into lp://qastaging/bzr-gedit

Proposed by Andrea Corbellini
Status: Needs review
Proposed branch: lp://qastaging/~andrea.corbellini/bzr-gedit/check-bzr-gtk
Merge into: lp://qastaging/bzr-gedit
To merge this branch: bzr merge lp://qastaging/~andrea.corbellini/bzr-gedit/check-bzr-gtk
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Needs Information
Javier Derderyan Abstain
Review via email: mp+1132@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

=== modified file 'setup.py'
--- setup.py 2008-09-16 03:32:14 +0000
+++ setup.py 2008-09-24 15:00:50 +0000
@@ -23,6 +23,12 @@
     except:
         missing['gtk'] = "Missing pygtk."

+ try:
+ print "testing bzr-gtk"
+ import bzrlib.plugins.gtk
+ except:
+ missing['bzrlib.plugins.gtk'] = "Missing bzr-gtk."
+
     if len(missing) != 0:
         print "Can't install. Required files missing:"
         for miss in missing:
@@ -33,7 +39,7 @@
          if sys.argv[2][0:10] == '-location=':
              destdir = sys.argv[2][10:]
              if destdir[-1] != '/':
- destdir +="/"
+ destdir +="/"
          else:
              destdir = expanduser("~/.gnome2/gedit/plugins/")
  else:

Revision history for this message
Javier Derderyan (javierder) wrote :

Hi,

The idea of using bzr-gtk inside bzr-gedit is that only if bzr-gtk is installed those parts will work. If not, it just shows an error message.

I think I talked it in the mailing list about this and we came to the conclusion that bzr-gtk is not something "needed".

Maybe an optional argument in setup to force bzr-gtk? Or an optional argument in setup to don't force bzr-gtk?

What do you think?

review: Abstain
Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

Thanks for the reply,
I've added the check because without bzr-gtk the only error shown is in the terminal and doesn't describe the situation well:

$ gedit
Traceback (most recent call last):
  File "/home/andrea/.gnome2/gedit/plugins/bzr/__init__.py", line 81, in <module>
    import dialogs
  File "/home/andrea/.gnome2/gedit/plugins/bzr/dialogs.py", line 5, in <module>
    from widgets import OptionsBox, TreeChanges
  File "/home/andrea/.gnome2/gedit/plugins/bzr/widgets.py", line 9, in <module>
    from bzrlib.plugins.gtk import gettext
ImportError: No module named gtk

** (gedit:7277): WARNING **: Cannot load plugin 'bzr' since file '/home/andrea/.gnome2/gedit/plugins' cannot be read.

Most of the users doesn't start gedit from the shell, so they won't be able to use bzr-gedit nor to know what's happening. Once I forgot to install bzr-gtk and I was a bit confused. :-)
This is why I'd prefer to have an optional argument to don't force bzr-gtk.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

What about greying out the options that require bzr-gtk and/or displaying a dialog informing the user that bzr-gtk was not found and some functionality might not be available?

review: Needs Information (code)
Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

Hi Jelmer. I like your proposals, and I think that graying out the options would be perfect (maybe also showing a clear message on stdout).

I'll create a new branch as soon as I can. Unfortunately, this month and the next one I'll be very busy. :-(

Anyhow, thank you Javier and Jelmer for your feedback!

Unmerged revisions

123. By Andrea Corbellini

Check bzr-gtk before install.

Subscribers

People subscribed via source and target branches

to all changes: