From: Leo U. <leo...@ya...> - 2005-08-10 15:19:48
|
Hi! I would but after some further investigation, Im not sure it is Jython's fault in this case. An example: module testimport.py: class test1( java.lang.Object ): ...pass class test2( java.lang.Object ): ...pass class test3( java.lang.Object ): ...pass import testimport dir( testimport ) [ all the classes are there! ] ------- Im starting to suspect strongly that what Im seeing is not a Jython import bug but a load dependency bug within jyleo's code. For example, in a Jython prompt: >>>import leoSwingFrame #leoSwingFrame was the offending module yesterday ...lots of gibberish ...NullPointerException tossed. in SwingMacs.py at the top of the import section, we have these lines import leoSwingFrame print leoSwingFrame #yes its a module print dir( leoSwingFrame ) #--- >>> hmmm no leoSwingTree, no leoSwingLog, etc.... #no NullPointerException tossed, as in the jython prompt... moving this into the constructor of the SwingMacs class: import leoSwingFrame print leoSwingFrame # yes its a module print dir( leoSwingFrame ) # -- >>> hmmm.... everything is there... something smells funny in jyleo land.... #looks like I can now fully reference the classes, that's weird.... Ill be doing some more testing of this in the coming days. If I can pinpoint it to jython Ill post a bug report. leouser brian zimmer <bz...@zi...> wrote: Can you open a bug at sourceforge so this can be tracked. I am fixing a couple of other import issues. Is this pure python or are you mixing Java and python classes in the module? thanks, brian > howdy Jython Makers, > > I didn't see a bug on this, but I wanted to run this down with you folks > before I entered one. Today I was trying to import a module that has 3 + > classes defined within it. I could import the module and see all of its > attributes but no classes! Hence in the importing module I could not > import the class I was trying to work with. Stranger yet, with another > module that had 1 class defined within it, I could import it and get at > the 1 class. > > so: > dir( module_with_many_classes ) > [ many things, but no classes ] > > dir( module_with_one_class ) > [ one class ] > > Thankfully this has not caused the existing codebase to crash when > running. After persuing the other import emails on this thread, I didn't > see any exact similarity between what I saw and what they were reporting. > > Thanks! > leouser > > > > --------------------------------- > Start your day with Yahoo! - make it your home page __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |