On Sun, Aug 12, 2012 at 7:43 AM, Rene Maurer <[email protected]> wrote:
> On 08/12/2012 at 03:08 C Anthony Risinger <[email protected]> wrote:
>>
>> Did you import pyjd, very _first_ thing?
>
> Yes.
>
> It is just the "Calendar widget", which cannot be imported:
>
> from pyjamas.ui.Calendar import DateField
>
> Traceback (most recent call last):
>   File "DesktopTest.py", line 13, in <module>
>     from pyjamas.ui.Calendar import DateField
>   File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 140, in
> _import_hook return importer._finish_import(top_module, parts[1:],
> fromlist) File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line
> 253, in _finish_import bottom = self._load_tail(top, parts)
>   File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 349, in
> _load_tail m = self._import_one(m, part, fqname)
>   File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 299, in
> _import_one module = self._process_result(result, fqname)
>   File "/usr/lib/python2.7/site-packages/pyjd/imputil.py", line 329, in
> _process_result exec code in module.__dict__
>   File
> "/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/Calendar.py",
> line 397, in <module> class DateField(Composite): File
> "/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/Calendar.py",
> line 399, in DateField img_base = pygwt.getImageBaseURL(True) File
> "/home/rene/Local/python/pyjs/pyjs/library/pygwt.py", line 44, in
> getImageBaseURL return getModuleBaseURL() + "images/" File
> "/home/rene/Local/python/pyjs/pyjs/library/pygwt.py", line 28, in
> getModuleBaseURL s = get_main_frame().getUri() AttributeError:
> 'NoneType' object has no attribute 'getUri'

hmm, and this works in pythonwebkit?  no changes?

im having a hard time figuring out how this can possibly work in
either, until pyjd.setup() has been called.

pyjd.setup -> set_main_frame

... this might be a lower level bootstrapping issue, as this image uri
stuff was only recently changed:

https://github.com/pyjs/pyjs/commit/64299dbb4558fbd8d3b2772108675af9da70e2a3

... but this change was modeled after :

https://github.com/pyjs/pyjs/blob/master/library/pyjamas/ui/Calendar.py#L399

... the difference being that the latter sets the attribute on an
instance ... not the class (creation-time), which is much much later.
so, my guess is this change doesn't work for *any* of the
direct/native runners.

i'll cook a small patch to fix then you can try again.

-- 

C Anthony

-- 



Reply via email to