Bug#431962: python-gnome2-desktop: gtksourceview.SourceTagStyle().mask is not writable
Josselin Mouette
joss at debian.org
Tue Jul 17 21:55:33 UTC 2007
Le vendredi 06 juillet 2007 à 13:29 +0200, Adeodato Simó a écrit :
> Package: python-gnome2-desktop
> Version: 2.18.0-2
> Severity: normal
> Tags: upstream
>
> Hello.
>
> It seems that the 'mask' attribute of gtksourceview.SourceTagStyle
> objects is not writable, but instead derived whenever
> SourceTagSytle.foreground or SourceTagStyle.background are set (see
> gtksourceview.override).
>
> I see no reason for this to be this way, since it breaks setting all
> three foreground, background and mask, letting the TagStyle object
> figure out which colors to finally use. Which works from C (it's what
> gedit does, see string_to_tag_style() in gedit-languages-manager.c).
>
> All this makes it necessary when working in Python code to check the
> value of mask, and refraining from setting foreground or background
> colors according to its value, which seems more unpythonic to me than
> having the attribute writable.
The upstream developers don't intend to change that:
"I disagree. The 'mask' field only exists because of limitations in the C
language. In Python we can instead automatically compute mask based on the
attributes that have been actually set, which is more intuitive and less error
prone. I don't know why you'd ever want to e.g. modify style.background but
not set the flag in style.mask saying background was set."
AIUI you don't need to refrain from setting anything and the mask is
automatically computed.
If you need more information, I suggest you followup on the upstream
bug: http://bugzilla.gnome.org/show_bug.cgi?id=456750
Cheers,
--
.''`.
: :' : We are debian.org. Lower your prices, surrender your code.
`. `' We will add your hardware and software distinctiveness to
`- our own. Resistance is futile.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message
=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url : http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20070717/75c1ee2b/attachment-0001.pgp
More information about the pkg-gnome-maintainers
mailing list