From: Glen S. <gl...@en...> - 2001-07-09 23:57:34
|
On Mon, 09 Jul 2001, Robert Kuzelj wrote: > hi, > > can anybody explain this strange behavior when > loading a folder as a resource? > > why can i load "/java/util" as a folder > but cannot load "/org/jdom" ? > > even after loading a class from "/org/jdom" i still cannot > laod the directory. I would venture to guess that it has something to do with __init__.py. I may be completely wrong, but I would guess that Jython creates a token __init__.py for the known Java libs (anything under java.* or javax.*), but not for arbitrary packages, such as org.jdom Just a guess though... > > > C:\data\develop\pyparser\src_python>jython > Jython 2.1a1 on java1.3.0 (JIT: null) > Type "copyright", "credits" or "license" for more information. > >>> from java.lang import String > >>> > >>> res = String.getResource("/java/util") > >>> print res > jar:file:/C:/develop/java/jdk/jre/lib/rt.jar!/java/util > >>> > >>> res = String.getResource("/org/jdom") > >>> print res > None > >>> res = String.getResource("/org/jdom/Element.class") > >>> print res > jar:file:/C:/develop/java/jdom/jdom.jar!/org/jdom/Element.class > >>> > >>> from org.jdom import Element > >>> > >>> res = String.getResource("/org/jdom") > >>> print res > None > >>> > > > any help is appreciated. > > ciao robertj > > ===== > itemj > http://www.itemj.com > Robert Kuzelj > Gaissacherstrasse 7 > 81371 Muenchen > tel 0177 5302230 > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail > http://personal.mail.yahoo.com/ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users -- So what can we do? There is only one solution. Start killing. If you know someone who is excited about compileable ASP code... KILL THEM. If you know someone who has Visual Studio .NET beta... KILL THEIR WHOLE FAMILY. -- /. posting |