I am sorry, Luke! I have been sending my question three times to you. For the last time, I have forgotten to enclose the important logfile. So here am I. I hope it will be sufficient.
Tovim -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Luke Kenneth Casson Leighton Sent: Sunday, December 11, 2011 1:06 PM To: [email protected] Subject: Re: gjs_attr On Sun, Dec 11, 2011 at 10:48 AM, Tovim <[email protected]> wrote: > Hi, Luke! > > I am trying to do something with pyjamas but with a little success. The > detailed explanation of my running the > > „helloworld“ example is in the enclosed file. > > I have met with three problems: > > o the code was not able to find the __pyjamas__ module (ad.6) > > o this module referenced (line 9) the nonexistent name „print_stack“ in > the traceback.py file > > o I have terminated with the verdict: 'NoneType' object has no attribute > 'gjs_get_global_context' > > > > No rails layed, I can´t move forward. Can you help me? ok, i've been re-reading the FAQ, and i re-discovered the Q/A about "context". before being able to help you further, tovim, you need to provide much better context. therefore, please read from about bullet-point 6 onwards: http://pyjs.org/faq/answers/im_developing_my_app_i_need_help_what_do_i_do.html many thanks, l.
Microsoft Windows XP [Verze 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. According to Mike Truty´s article (http://pyjs.org/wiki/installingpyjamasandpyjamasdesktopforwindows/) and CLaw´s article (http://clawcoder.blogspot.com/2011/03/now-for-good-stuff-followed-wiki-post.html), I have gone through these steps: 1) Python installation: Python 2.6.6 (Aug 24 2010) 2) Pyjamas installation: pyjamas-0.8alpha1 into c:/pyjamas/pyjas8 3) Comtypes installation: comtypes-0.6.2 win32.exe into c:/python26/lib/site- packages/comptypes 4) cd pyjamas/pyjas8 > python bootstrap.py 5) added c:\pyjamas\pyjas8\bin; into PATH environment variable; python26 being there already 6) Now, I am trying to go through the "helloworld" example: c:\>cd pyjamas/pyjas8/examples/helloworld c:\pyjamas\pyjas8\examples\helloworld>pyjsbuild.bat Hello.py Resulted in ... ~/pyjs/src/pyjs/lib/re.py line 100: from __pyjamas__ import JS, debugger ImportError: no module __pyjamas__ So I copied ~/library/__pyjamas__ file into ~/pyjs/src/pyjs/lib/ and tried again: 7) c:\pyjamas\pyjas8\examples\helloworld>pyjsbuild.bat Hello.py Building : Hello PYJSPATH : [ c:\pyjamas\pyjas8\examples\helloworld c:\pyjamas\pyjas8\library c:\pyjamas\pyjas8\addons ] Translating : c:\pyjamas\pyjas8\pyjs\src\pyjs\lib\sys.py Traceback (most recent call last): File "c:\pyjamas\pyjas8\bin\pyjsbuild.py", line 21, in <module> pyjs.browser.build_script() File "c:\pyjamas\pyjas8\pyjs\src\pyjs\browser.py", line 542, in build_script runtime_options, args) File "c:\pyjamas\pyjas8\pyjs\src\pyjs\browser.py", line 395, in build l() File "c:\pyjamas\pyjas8\pyjs\src\pyjs\linker.py", line 236, in __call__ raise e pyjs.translator.TranslationError: line Unknown: 'import site' failed; use -v for traceback Traceback (most recent call last): File "c:\pyjamas\pyjas8\pyjs\src\pyjs\translator.py", line 21, in <module> import re File "re.py", line 100, in <module> from __pyjamas__ import JS, debugger File "__pyjamas__.py", line 9, in <module> from traceback import print_stack ImportError: cannot import name print_stack Well, loking into ~/pyjs/src/pyjs/lib/traceback.py, I have found, that there was no name "print_stack" - only "format_exception", so I´ve changed the calling in __pyjamas__ to this name. 8) c:\pyjamas\pyjas8\examples\helloworld>pyjsbuild.bat Hello.py Building : Hello PYJSPATH : [ c:\pyjamas\pyjas8\examples\helloworld c:\pyjamas\pyjas8\library c:\pyjamas\pyjas8\addons ] Translating : c:\pyjamas\pyjas8\pyjs\src\pyjs\lib\sys.py Traceback (most recent call last): File "c:\pyjamas\pyjas8\bin\pyjsbuild.py", line 21, in <module> pyjs.browser.build_script() File "c:\pyjamas\pyjas8\pyjs\src\pyjs\browser.py", line 542, in build_script runtime_options, args) File "c:\pyjamas\pyjas8\pyjs\src\pyjs\browser.py", line 395, in build l() File "c:\pyjamas\pyjas8\pyjs\src\pyjs\linker.py", line 236, in __call__ raise e pyjs.translator.TranslationError: line Unknown: 'import site' failed; use -v for traceback Traceback (most recent call last): File "c:\pyjamas\pyjas8\pyjs\src\pyjs\translator.py", line 21, in <module> import re File "re.py", line 102, in <module> __inline_flags_re__ = JS(r"""new RegExp("[(][?][iLmsux]+[)]")""") File "__pyjamas__.py", line 54, in JS ctx = main_frame.gjs_get_global_context() AttributeError: 'NoneType' object has no attribute 'gjs_get_global_context' 9) So I am at the end of my journey in pyjamas. The definition of the JS(code) function contains this warning: "try to avoid using this function, it will only give you grief right now". Well, it really does. The " AttributeError: 'NoneType' object has no attribute 'gjs_get_global_context' " sentence appears in Hello2.py and OnClickTest.py (and maybe others) too. Some links: http://osdir.com/ml/pyjamas-dev/2009-12/msg00078.html ... you just can't easily *INTERACT* with javascript. it's complicated.

