On 08/25/2012 at 00:08 C Anthony Risinger <[email protected]> wrote:
> On Thu, Aug 23, 2012 at 6:42 AM, Rene Maurer <[email protected]>
> wrote:

>> This one doesn't:
>>   tb = TextBox()
>>   tb.setText(u"öäüéàè")
>>
>> => File
>> "/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/TextBoxBase.py",
>> line 113, in setText DOM.setAttribute(self.getElement(), "value",
>> str(text)) UnicodeEncodeError: 'ascii' codec can't encode
>> characters in position 0-11: ordinal not in range(128)
>>
>> This one works again:
>>   tb = TextBox()
>>   tb.setText(u"öäüéàè".encode("utf-8"))

> does this work in other runners? like the pywebkitgtk one?

Sorry I don't have a running pywebkitgtk version available right now. I
can test Reit next week.

> ... shows very few places this is done; i think it would be OK to drop
> the str() call here.  can you verify removing the call to str() works
> fine?

I have modified  ' library/pyjamas/ui/TextBoxBase.py:'

def setText(self, text):
   # -OLD- DOM.setAttribute(self.getElement(), "value", str(text))
   DOM.setAttribute(self.getElement(), "value", text)

Of course this works. IMHO it doesn't make sense to replace the other
calls to str()...

>> python2 Desktop.py
>> Traceback (most recent call last):
>>   File "Desktop.py", line 8, in <module>
>>     import pyjd
>>   File "/usr/lib/python2.7/site-packages/pyjd/__init__.py", line 5,
>> in <module> from pyjs.runners import RunnerManager
>> ImportError: No module named runners
>>
>> "import pyjd" is the very first statement in Desktop.py. I have
>> cleaned everything and installed from scratch. So maybe I have just
>> forgotten something.
> 
> have you installed from a recent build? 

git clone https://github.com/pyjs/pyjs.git
git checkout feature/giwebkit

Still the same (no problem at all for me right now).


> say (hypothetical):
> 
> pyjs runner --backend="giwebkit" --root="/path/to/..." --fullscreen
> /path/to/my/application.py

Nice!

René

-- 



Reply via email to