Windows Time.mshtml is missing pyjd.threading and pyjd.add_timer_queue

16 views
Skip to first unread message

ming

unread,
Jun 10, 2014, 3:48:05 PM6/10/14
to pyjs-...@googlegroups.com
Hi, The Timer is not working on windows. I tracked to the Timer.mshtml.py. It looks it is missing reference to pyjd.threading and pyjd.add_timer_queue().

In the old release, the pyjd/__init__.py imports mshtml, that contains add_timer_queue(). Subsequently mshtml imports threading thus making it visible to all the user objects.

How this can be worked around, even if not by a full fix?


More info: I added a break point in imputil.py at the 2nd print line below:

     def _import_hook(self, fqname, globals=None, locals=None, fromlist=None,
                            level=-1):
         """Python calls this hook to locate and import a module."""
 
         parts = fqname.split('.')
+        if 'Timer' in fqname:
+            print "    Time in fqname ", fqname, " to load... ", __file__, "\n"
+            print "    Time in fqname ", fqname, " ... "

From there it tracked to _fs_import() in imports.py, I can see when loading Timer it actually loads Timer.mshtml.

Any hinds or comments are more than welcome.

Thanks.

ming

unread,
Jun 10, 2014, 7:00:10 PM6/10/14
to pyjs-...@googlegroups.com
Got a hack to make it work. This is hardly the real fix as it does not play well with Linux as I assume.

Change at the end of pyjd/__init__.py:

 add_setup_callback = _manager.add_setup_listener
 setup = _manager.setup
 run = _manager.run
+add_timer_queue = _manager.add_timer_queue
+import threading

Change to pyjd/runners/__init__.py:

     def run(self, *args, **kwds):
         self._runner.run(*args, **kwds)
 
+    def add_timer_queue(self, *args, **kwds):
+        self._runner.add_timer_queue(*args, **kwds)

Can some expert point me how a real fix should look like?

Reply all
Reply to author
Forward
0 new messages