Anthony Kong | 1 Aug 03:38

Question about ihook

Hi, all,
 
Just a little bit of background, I am trying to run an existing application which use Webware 0.8 using jython.
 
Here is some stack trace:
 
    from AppServer import AppServer
  File "C:\FPD\Webware-0.8.1\WebKit\AppServer.py", line 13, in <module>
    from ConfigurableForServerSidePath import ConfigurableForServerSidePath
  File "C:\FPD\Webware-0.8.1\WebKit\ConfigurableForServerSidePath.py", line 1, i
n <module>
    from MiscUtils.Configurable import Configurable, NoDefault
  File "C:\FPD\Webware-0.8.1\MiscUtils\Configurable.py", line 4, in <module>
    from WebKit.ImportSpy import modloader
  File "C:\FPD\Webware-0.8.1\WebKit\ImportSpy.py", line 1, in <module>
    import ihooks
ImportError: No module named ihooks
 
So, I am just wondering
1) is there any workaround ?
2) why ihooks is not present? Is it due to any technical limitation (of java)?
 
Cheers
 

NOTICE

This e-mail and any attachments are confidential and may contain copyright material of Macquarie Group Limited or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Group Limited does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Group Limited.

 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Nicholas Riley | 1 Aug 21:55

Re: Question about ihook

In article 
<FB83E9898C8DDE4CA58DFFCA5CE455C802A0472F <at> ntsydexm03.pc.internal.macquar
ie.com>,
 "Anthony Kong" <Anthony.Kong <at> macquarie.com> wrote:

> ImportError: No module named ihooks
>  
> So, I am just wondering
> 1) is there any workaround ?
> 2) why ihooks is not present? Is it due to any technical limitation (of
> java)?

I was able to get past this by adding ihooks.py and fixing a constant so 
Jython could import it, but it revealed another problem.

Webware uses the marshal module, which is not supported in Jython.  This 
is not a recommended practice (see 
http://docs.python.org/lib/module-marshal.html); it may be possible to 
get Webware working by replacing it with the pickle module.

Note - this only applies to Webware 0.8.1; current versions of Webware 
choke during install because of a parser error:

  File "/Users/nicholas/zilles/Webware-0.9.4/DocSupport/pytp.py", line 
154, in process
    exec pi in scope
  File "<string>", line 2
   results = []
   ^
SyntaxError: line 2:0 mismatched input 'results' expecting INDENT 
(<string>, line 2)
--

-- 
Nicholas Riley <njriley <at> uiuc.edu>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Anthony Kong | 2 Aug 01:20

Re: Question about ihook

Thanks Nicholas,

The doc generation was also a problem for me, so I simply by-passed it.

Just some follow-up questions to the mailing list:

1) the ihooks.py is present in the jython 2.2 svn repos, so any reason why it is not in 2.5a1?
2) If i used this ihooks.py, the Webware will run but will hit another problem: missing attribute C_BULITIN. So, what is this C_BUILTIN

Is it something easy to fix?

Cheers, Anthony


On Sat, Aug 2, 2008 at 5:55 AM, Nicholas Riley <njriley <at> uiuc.edu> wrote:
In article
<FB83E9898C8DDE4CA58DFFCA5CE455C802A0472F <at> ntsydexm03.pc.internal.macquar
ie.com>,
 "Anthony Kong" <Anthony.Kong <at> macquarie.com> wrote:

> ImportError: No module named ihooks
>
> So, I am just wondering
> 1) is there any workaround ?
> 2) why ihooks is not present? Is it due to any technical limitation (of
> java)?

I was able to get past this by adding ihooks.py and fixing a constant so
Jython could import it, but it revealed another problem.

Webware uses the marshal module, which is not supported in Jython.  This
is not a recommended practice (see
http://docs.python.org/lib/module-marshal.html); it may be possible to
get Webware working by replacing it with the pickle module.

Note - this only applies to Webware 0.8.1; current versions of Webware
choke during install because of a parser error:

 File "/Users/nicholas/zilles/Webware-0.9.4/DocSupport/pytp.py", line
154, in process
   exec pi in scope
 File "<string>", line 2
  results = []
  ^
SyntaxError: line 2:0 mismatched input 'results' expecting INDENT
(<string>, line 2)
--
Nicholas Riley <njriley <at> uiuc.edu>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
Nicholas Riley | 2 Aug 01:58

Re: Question about ihook

In article 
<b0b163580808011620p2b15152cp3d230cab32b16c92 <at> mail.gmail.com>,
 "Anthony Kong" <anthony.hw.kong <at> gmail.com> wrote:

> Thanks Nicholas,
> 
> The doc generation was also a problem for me, so I simply by-passed it.
> 
> Just some follow-up questions to the mailing list:
> 
> 1) the ihooks.py is present in the jython 2.2 svn repos, so any reason why
> it is not in 2.5a1?

I don't see it in 2.2:

http://jython.svn.sourceforge.net/svnroot/jython/branches/Release_2_2main
t/jython/Lib/

> 2) If i used this ihooks.py, the Webware will run but will hit another
> problem: missing attribute C_BULITIN. So, what is this C_BUILTIN
> 
> Is it something easy to fix?

Yes, it's just a constant, easy enough to fix.

http://fisheye3.atlassian.com/browse/jython/branches/asm/src/org/python/m
odules/imp.java?r1=4914&r2=5041

If you're already on 2.5a1, just check out and build the asm branch; it 
will install ihooks.py.

One more thing I needed to change was 'whrandom' to 'random'; 'whrandom' 
is not available in CPython 2.5 either.
--

-- 
Nicholas Riley <njriley <at> uiuc.edu>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane