GTG

GTG doesn't work with pygtk < 2.14

Bug #398861 reported by Adam Plumb
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GTG
Fix Released
Wishlist
Bertrand Rousseau

Bug Description

I'm on Ubuntu 8.04 and am using GTG 0.1.2.

I created a task and added a tag, then gave the tag a color by right-clicking and selecting "Color". However, once I chose the color and OKed it, I decided I wanted a new color and tried going into the color selector again, but it wouldn't show up. I then closed GTG and ran it from the command line. Now, when I click on Color, I get the following traceback every time. Note that this error only occurs the second time I set a color. The popup dialog always appears the first time and I'm able to select a color.

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/GTG/taskbrowser/browser.py", line 501, in on_colorchooser_activate
    colorspec = gtk.gdk.Color(color)
TypeError: an integer is required
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/GTG/taskbrowser/browser.py", line 501, in on_colorchooser_activate
    colorspec = gtk.gdk.Color(color)
TypeError: an integer is required

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote : Re: [Bug 398861] [NEW] Setting tag color results in TypeError: an integer is required error

That's bad, I don't have a 8.04 to test it and cannot reproduce this bug
on 9.04.

I wonder if this is not related to major changes in python/pygtk
version. If you can, can you try to reproduce this on an OS with python
2.6 installed ?

Le lundi 13 juillet 2009 à 15:44 +0000, Adam Plumb a écrit :
> Public bug reported:
>
> I'm on Ubuntu 8.04 and am using GTG 0.1.2.
>
> I created a task and added a tag, then gave the tag a color by right-
> clicking and selecting "Color". However, once I chose the color and
> OKed it, I decided I wanted a new color and tried going into the color
> selector again, but it wouldn't show up. I then closed GTG and ran it
> from the command line. Now, when I click on Color, I get the following
> traceback every time. Note that this error only occurs the second time
> I set a color. The popup dialog always appears the first time and I'm
> able to select a color.
>
> Traceback (most recent call last):
> File "/usr/lib/python2.5/site-packages/GTG/taskbrowser/browser.py", line 501, in on_colorchooser_activate
> colorspec = gtk.gdk.Color(color)
> TypeError: an integer is required
> Traceback (most recent call last):
> File "/usr/lib/python2.5/site-packages/GTG/taskbrowser/browser.py", line 501, in on_colorchooser_activate
> colorspec = gtk.gdk.Color(color)
> TypeError: an integer is required
>
> ** Affects: gtg
> Importance: Undecided
> Status: New
>

Revision history for this message
Adam Plumb (adamplumb) wrote : Re: Setting tag color results in TypeError: an integer is required error

Here's a quick response. I looked in the sourcecode and added some print lines for debugging. Here is that section of code with the new prints:

        tags,notag_only = self.get_selected_tags() #pylint: disable-msg=W0612
        print tags
        print notag_only
        if len(tags) == 1:
            print "tags is one"
            color = tags[0].get_attribute("color")
            print "color is %s" % color
            if color != None:
                print "Color is not none"
                colorspec = gtk.gdk.Color(color)
                colorsel = window.colorsel
                colorsel.set_previous_color(colorspec)
                colorsel.set_current_color(colorspec)

And here is the output:

[<GTG.core.tagstore.Tag instance at 0xd131b8>]
False
tags is one
color is #000000
Color is not none
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/GTG/taskbrowser/browser.py", line 506, in on_colorchooser_activate
    colorspec = gtk.gdk.Color(color)
TypeError: an integer is required

A quick check here: http://www.pygtk.org/docs/pygtk/class-gdkcolor.html#function-gdk--color-parse

When I change the line colorspec = gtk.gdk.Color(color) to colorspec = gtk.gdk.color_parse(color), then everything works great.

Looks like this may be an API/ABI breakage issue somewhere, though I'm not sure where exactly.

Revision history for this message
Adam Plumb (adamplumb) wrote :

I didn't see this before, but according to the pygtk page I linked to in my previous post, the constructor you're using is not available until pygtk 2.14, and ubuntu 8.04 only has pygtk 2.12.

It's up to you if you want to support 8.04 or not, but fortunately I was able to modify my own code and it works nicely now ;)

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

hey Adam, thanks for the investigation. It mades sense as we started developping gtg on Ubuntu 8.10.

The question is, of course, if your change will work with later version of pygtk and why this was changed in the API. Then, we will be able to decide if it worths supporting 8.04.

To be honnest, we still see GTG as an highly experimental software, thus making no sense to support it on stable release. But we hope to have a very nice GTG in the next LTS 10.04 :-)

summary: - Setting tag color results in TypeError: an integer is required error
+ GTG doesn't work with pygtk < 2.14
Changed in gtg:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Bertrand, as you are working on the browser, can you change gdk.Color by gdk.color_parse ? It looks like there is no drawback.

Changed in gtg:
assignee: nobody → Lionel Dricot (ploum)
milestone: none → 0.2
status: Confirmed → In Progress
assignee: Lionel Dricot (ploum) → Bertrand Rousseau (bertrand-rousseau)
Revision history for this message
Bertrand Rousseau (bertrand-rousseau) wrote : Re: [Bug 398861] [NEW] GTG doesn't work with pygtk < 2.14

Done in lp:~bertrand-rousseau/gtg/refactor r261. Still not merged in
trunk, though.

On Fri, Jul 24, 2009 at 12:44 PM, Launchpad Bug
Tracker<email address hidden> wrote:
> You have been subscribed to a public bug:
>
> I'm on Ubuntu 8.04 and am using GTG 0.1.2.
>
> I created a task and added a tag, then gave the tag a color by right-
> clicking and selecting "Color".  However, once I chose the color and
> OKed it, I decided I wanted a new color and tried going into the color
> selector again, but it wouldn't show up.  I then closed GTG and ran it
> from the command line.  Now, when I click on Color, I get the following
> traceback every time.  Note that this error only occurs the second time
> I set a color.  The popup dialog always appears the first time and I'm
> able to select a color.
>
> Traceback (most recent call last):
>  File "/usr/lib/python2.5/site-packages/GTG/taskbrowser/browser.py", line 501, in on_colorchooser_activate
>    colorspec = gtk.gdk.Color(color)
> TypeError: an integer is required
> Traceback (most recent call last):
>  File "/usr/lib/python2.5/site-packages/GTG/taskbrowser/browser.py", line 501, in on_colorchooser_activate
>    colorspec = gtk.gdk.Color(color)
> TypeError: an integer is required
>
> ** Affects: gtg
>     Importance: Wishlist
>     Assignee: Bertrand Rousseau (bertrand-rousseau)
>         Status: In Progress
>
> --
> GTG doesn't work with pygtk < 2.14
> https://bugs.edge.launchpad.net/bugs/398861
> You received this bug notification because you are a bug assignee.
>

--
Bertrand Rousseau
Place communale 1, 1450 Chastre, Belgium
e-mail : <email address hidden>
tel : +32 485 96 69 86

Revision history for this message
Erdal Ronahi (erdalronahi) wrote :

The same problem exists in Lenny with the "testing" package (0.1.2), the same fix applies.

Lenny has also version 2.12 of pygtk, I was able to modify the line, now it works.

Changed in gtg:
status: In Progress → Fix Committed
Changed in gtg:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.