unicode page names in ListEditor

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

unicode page names in ListEditor

Alexander Held
Hi,

I tried to use unicode page names for the pages in a notebook
ListEditor, but in

https://github.com/enthought/traitsui/blob/dbf32b7908d8a146361baa2d99869c5a4615755d/traitsui/wx/list_editor.py#L783

the name is set via

name = str( name ) or '???'

which does not work, if name is unicode. Is calling str really necessary
at this point?
Both
name = name or '???'
or
name = unicode(name) or '???'

would do the job for me (but might spoil it for other use cases, when
name is neither unicode nor string?)
I can e.g. already use unicode for the names of Views in a Workbench,
which are also displayed in notebook style.
It would be nice to also have this for ListEditor, since I have
non-ascii characters in my language.

Alexander

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: unicode page names in ListEditor

Robert Kern
On Wed, Sep 19, 2012 at 4:39 PM, Alexander Held
<[hidden email]> wrote:

> Hi,
>
> I tried to use unicode page names for the pages in a notebook
> ListEditor, but in
>
> https://github.com/enthought/traitsui/blob/dbf32b7908d8a146361baa2d99869c5a4615755d/traitsui/wx/list_editor.py#L783
>
> the name is set via
>
> name = str( name ) or '???'
>
> which does not work, if name is unicode. Is calling str really necessary
> at this point?
> Both
> name = name or '???'
> or
> name = unicode(name) or '???'
>
> would do the job for me (but might spoil it for other use cases, when
> name is neither unicode nor string?)
> I can e.g. already use unicode for the names of Views in a Workbench,
> which are also displayed in notebook style.
> It would be nice to also have this for ListEditor, since I have
> non-ascii characters in my language.

Quite correct. Does this PR fix the problem for you?

https://github.com/enthought/traitsui/pull/79

--
Robert Kern
Enthought
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: unicode page names in ListEditor

Alexander Held
On 19.09.2012 18:05, Robert Kern wrote:

> On Wed, Sep 19, 2012 at 4:39 PM, Alexander Held
> <[hidden email]> wrote:
>> Hi,
>>
>> I tried to use unicode page names for the pages in a notebook
>> ListEditor, but in
>>
>> https://github.com/enthought/traitsui/blob/dbf32b7908d8a146361baa2d99869c5a4615755d/traitsui/wx/list_editor.py#L783
>>
>> the name is set via
>>
>> name = str( name ) or '???'
>>
>> which does not work, if name is unicode. Is calling str really necessary
>> at this point?
>> Both
>> name = name or '???'
>> or
>> name = unicode(name) or '???'
>>
>> would do the job for me (but might spoil it for other use cases, when
>> name is neither unicode nor string?)
>> I can e.g. already use unicode for the names of Views in a Workbench,
>> which are also displayed in notebook style.
>> It would be nice to also have this for ListEditor, since I have
>> non-ascii characters in my language.
> Quite correct. Does this PR fix the problem for you?
>
> https://github.com/enthought/traitsui/pull/79
>

Yes, this PR fixes the problem for me. Thanks.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev