<div dir="ltr"><div><div><div>Hi Tim,<br></div>thanks for the quick reply! I have just updated the pymol package and I can confirm that the bug is no longer there!<br></div><div>Do you think it might be worth to push this bug to upstream? from what I can understand googling the issue there seems to be almost nobody else experiencing it...let me know what you think, I can open the bugreport if you wish.<br></div>thanks again a lot,<br></div>Cheers,<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-27 15:39 GMT+02:00 Tim Booth <span dir="ltr">&lt;<a href="mailto:tbooth@ceh.ac.uk" target="_blank">tbooth@ceh.ac.uk</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Chiara,<br>
<br>
Confirmed this on my machine.  This is a bad bug as it makes a whole<br>
chunk of Pymol functionality unavailable.  As you say, it seems to be an<br>
issue with tkinter, but very specific to calling grid_info(), which is<br>
only used once in the Pymol code.<br>
<br>
Therefore, rather than attempt to debug tkinter (which is probably<br>
beyond me!) I&#39;ve added a workaround patch.  I&#39;ve also upgraded the Pymol<br>
package from 1.7.0 to 1.7.2.1 while I was at it.  The new package should<br>
appear in the software updater for you now.<br>
<br>
If you are interested, here is the patch:<br>
<br>
tbooth@balisaur$ cat 32_workaround_grid_info_bug.patch<br>
--- a/modules/pmg_tk/skins/normal/builder.py<br>
+++ b/modules/pmg_tk/skins/normal/builder.py<br>
<br>
     def toggleChemProtein(self):<br>
-        if self.chemFrame.grid_info():<br>
-            self.chemB.configure(relief=RAISED)<br>
-            self.chemFrame.grid_forget()<br>
-            self.protB.configure(relief=SUNKEN)<br>
-            self.protFrame.grid(row=1, column=2, rowspan=4, sticky=W)<br>
-        else:<br>
-            self.chemB.configure(relief=SUNKEN)<br>
-            self.chemFrame.grid(row=1, column=2, rowspan=4, sticky=W)<br>
-            self.protB.configure(relief=RAISED)<br>
-            self.protFrame.grid_forget()<br>
+        #Nasty workaround for grid_info bug in Ubuntu 14.04.<br>
+        try:<br>
+            if self.chemFrame.grid_info(): raise TypeError()<br>
+            #If we get to here it means the chemFrame is not active<br>
+            self.protFrame.grid_forget()<br>
+            self.chemFrame.grid(row=1, column=2, rowspan=4, sticky=W)<br>
+            self.protB.configure(relief=RAISED)<br>
+            self.chemB.configure(relief=SUNKEN)<br>
+        except TypeError:<br>
+            self.chemFrame.grid_forget()<br>
+            self.protFrame.grid(row=1, column=2, rowspan=4, sticky=W)<br>
+            self.chemB.configure(relief=RAISED)<br>
+            self.protB.configure(relief=SUNKEN)<br>
<br>
 ############################################################<br>
<br>
Hopefully that sorts it.<br>
<br>
Cheers,<br>
<br>
TIM<br>
<div><div class="h5"><br>
On Wed, 2015-05-27 at 10:55 +0200, chiara cocconcelli wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I&#39;m using Biolinux 8 with pymol from the repositories but I am<br>
&gt; encountering a tkinter-related bug. Steps to reproduce:<br>
&gt;<br>
&gt;<br>
&gt; 1) open pymol<br>
&gt;<br>
&gt; 2) in the list of buttons on the right click the Builder one<br>
&gt;<br>
&gt; 3) in the panel that opens click Protein on the left<br>
&gt;<br>
&gt;<br>
&gt; the function is not called and this error is raised:<br>
&gt;<br>
&gt; Error: 1<br>
&gt; &lt;type &#39;exceptions.TypeError&#39;&gt; Exception in Tk callback<br>
&gt;   Function: &lt;bound method Builder.toggleChemProtein of<br>
&gt; &lt;pmg_tk.skins.normal.builder.Builder instance at 0x7ffb82e56ea8&gt;&gt;<br>
&gt; (type: &lt;type &#39;instancemethod&#39;&gt;)<br>
&gt;   Args: ()<br>
&gt; Traceback (innermost last):<br>
&gt;   File &quot;/usr/lib/python2.7/dist-packages/Pmw/Pmw_1_3/lib/PmwBase.py&quot;,<br>
&gt; line 1747, in __call__<br>
&gt;     return apply(self.func, args)<br>
&gt;   File<br>
&gt; &quot;/usr/lib/python2.7/dist-packages/pmg_tk/skins/normal/builder.py&quot;,<br>
&gt; line 1458, in toggleChemProtein<br>
&gt;     if self.chemFrame.grid_info():<br>
&gt;   File &quot;/usr/lib/python2.7/lib-tk/Tkinter.py&quot;, line 2000, in grid_info<br>
&gt;     self.tk.call(&#39;grid&#39;, &#39;info&#39;, self._w))<br>
&gt; &lt;type &#39;exceptions.TypeError&#39;&gt;: coercing to Unicode: need string or<br>
&gt; buffer, _tkinter.Tcl_Obj found<br>
&gt;<br>
&gt;<br>
&gt; I can provide debugging on request and I have a bit of python<br>
&gt; understanding, please let me know how I can best diagnose this problem<br>
&gt;<br>
&gt; thanks in advance,<br>
&gt;<br>
&gt; regards<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Bio-Linux mailing list<br>
&gt; <a href="mailto:Bio-Linux@nebclists.nerc.ac.uk">Bio-Linux@nebclists.nerc.ac.uk</a><br>
&gt; <a href="http://nebclists.nerc.ac.uk/mailman/listinfo/bio-linux" target="_blank">http://nebclists.nerc.ac.uk/mailman/listinfo/bio-linux</a><br>
<br>
--<br>
Tim Booth &lt;<a href="mailto:tbooth@ceh.ac.uk">tbooth@ceh.ac.uk</a>&gt;<br>
NERC Environmental Bioinformatics Centre<br>
<br>
Centre for Ecology and Hydrology<br>
Maclean Bldg, Benson Lane<br>
Crowmarsh Gifford<br>
Wallingford, England<br>
OX10 8BB<br>
<br>
<a href="http://environmentalomics.org/bio-linux" target="_blank">http://environmentalomics.org/bio-linux</a><br>
<a href="tel:%2B44%201491%2069%202297" value="+441491692297">+44 1491 69 2297</a><br>
<br>
_______________________________________________<br>
Bio-Linux mailing list<br>
<a href="mailto:Bio-Linux@nebclists.nerc.ac.uk">Bio-Linux@nebclists.nerc.ac.uk</a><br>
<a href="http://nebclists.nerc.ac.uk/mailman/listinfo/bio-linux" target="_blank">http://nebclists.nerc.ac.uk/mailman/listinfo/bio-linux</a><br>
</blockquote></div><br></div>