Re: [Diffuse-users] Preferences update error?
Status: Beta
Brought to you by:
dtmoser
|
From: Eizan M. <eiz...@gm...> - 2014-05-13 17:32:47
|
Hi Derrick,
It seems like that fixes it. Thanks for the quick reply :)
FWIW,
$ python
Python 2.7.3 (default, Mar 14 2014, 11:57:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
>>> gtk.pygtk_version
(2, 24, 0)
Eizan
On Tue, May 13, 2014 at 6:22 PM, Derrick Moser <der...@ya...>wrote:
> Eizan,
>
> The preference value should never be None. I suspect the version of PyGTK
> on your system is returning None instead of a blank string from text
> widgets. Does the following patch fix the problem?
>
> Cheers,
> Derrick
>
> --- diffuse (revision 409)
> +++ diffuse (working copy)
> @@ -991,7 +991,7 @@
> for k in self.int_prefs.keys():
> self.int_prefs[k] = widgets[k].get_value_as_int()
> for k in self.string_prefs.keys():
> - self.string_prefs[k] = widgets[k].get_text()
> + self.string_prefs[k] = nullToEmpty(widgets[k].get_text())
>
> try:
> ss = []
> for k, v in self.bool_prefs.items():
>
> ------------------------------
> *From:* Eizan Miyamoto <eiz...@gm...>
> *To:* dif...@li...
> *Sent:* Tuesday, 13 May 2014, 13:04
> *Subject:* [Diffuse-users] Preferences update error?
>
> Hi everyone,
>
> I've recently come across a possible(?) bug in the most recent Diffuse
> release (0.4.7). Basically, when I try to update a particular preference
> item, the change won't take and I get some errors spit out to my console. I
> don't see anything related to this on the bug tracker.
>
> More specifically, when I tick Preferences->Display->ignore end of line
> differences, the following error is emitted:
>
> Traceback (most recent call last):
> File "/usr/bin/diffuse", line 8098, in preferences_cb
> if self.prefs.runDialog(self.get_toplevel()):
> File "/usr/bin/diffuse", line 1003, in runDialog
> ss.append('%s "%s"\n' % (k, v.replace('\\', '\\\\').replace('"',
> '\\"')))
> AttributeError: 'NoneType' object has no attribute 'replace'
>
> When I apply the following patch, the issue goes away, but it's a pretty
> messy hack:
>
> @@ -995,13 +995,13 @@ class Preferences:
> try:
> ss = []
> for k, v in self.bool_prefs.items():
> - if v != self.default_bool_prefs[k]:
> + if v is not None and v != self.default_bool_prefs[k]:
> ss.append('%s %s\n' % (k, v))
> for k, v in self.int_prefs.items():
> - if v != self.default_int_prefs[k]:
> + if v is not None and v != self.default_int_prefs[k]:
> ss.append('%s %s\n' % (k, v))
> for k, v in self.string_prefs.items():
> - if v != self.default_string_prefs[k]:
> + if v is not None and v !=
> self.default_string_prefs[k]:
> ss.append('%s "%s"\n' % (k, v.replace('\\',
> '\\\\').replace('"', '\\"')))
> ss.sort()
> f = open(self.path, 'w')
>
> Or, do I perhaps have Diffuse installed incorrectly? I installed it with:
> $ install.py --prefix=$HOME/opt --destdir=$HOME/opt
>
> note:
>
> $ uname -a
> Linux debian 3.2.0-4-486 #1 Debian 3.2.54-2 i686 GNU/Linux
> $ python --version
> Python 2.7.3
>
> Thanks!
>
> Eizan
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform
> available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Diffuse-users mailing list
> Dif...@li...
> https://lists.sourceforge.net/lists/listinfo/diffuse-users
>
>
>
|