Phillip,

The package scanner was designed so that that the index data could be retrieved from something besides the file system itself. If interested, look at the code in org.python.core.packagecache. But I'm not aware of any implementations that actually do this.

So here's a nice todo for Jython development: support in-memory or against a jar that contains the index (as might be built by setup.py). Yes, it's possible to workaround with explicit imports, but that's not just as desirable as enabling already working code to successfully run under a variety of distribution models.

- Jim

On Thu, Dec 10, 2009 at 12:34 PM, Phillip Decker <dec_ibmid@glasswinter.com> wrote:
   I take it from the docs that, at the moment, there's no way to get
the benefits of package scanning without an on-disk cache?  (Ie: there
is no facility for caching that info in ram?)

On Thu, Dec 10, 2009 at 11:32 AM, Jim Baker <jbaker@zyasoft.com> wrote:
> I have never used pawt - and I'm don't work with Swing either - but in a
> cursory glance at the code:
>
> Modest import magic of Java packages that requires a package cache. Doing an
> explicit import (that is, "from javax.swing.text import StyleContext,
> StyleConstants, TabSet") fixes that problem, as was noted earlier. More info
> here, http://wiki.python.org/jython/PackageScanning
> Some minor helper functionality for working with Swing.
>
> So I see no reason to use pawt, but on the other hand, we wouldn't remove it
> from Jython until Jython 3.x. It's mostly harmless :) - we just need to do a
> better job of deprecating its use. Hopefully this is a start.
>
> It would seem better to use Alex Grönholm's package,
> http://pypi.python.org/pypi/jython-swingutils/ - Alex may describe it as
> pre-alpha, but I believe he's using it in his own work quite successfully,
> and I like the code. In particular, it has extensive testing. But it needs
> real Swing users, not me, to help further vet it.
>
> - Jim
>
> On Thu, Dec 10, 2009 at 9:45 AM, Phillip Decker <dec_ibmid@glasswinter.com>
> wrote:
>>
>> > 2009/12/10 Marcos Sánchez Provencio <msanchez@grupoburke.com>:
>> > Strange...
>> >
>> > Anyway, Lib/pawt/swing.py does some magic that you may not need. In
>> > fact, if you change the first line of Demo/swing/Styles.py to:
>> > from javax.swing.text import StyleContext, StyleConstants, TabSet,
>> > TabStop
>> > your test does work.
>> >
>> > El mié, 09-12-2009 a las 19:32 -0700, Phillip Decker escribió:
>> >> java -Dpython.cachedir.skip=true -jar jython.jar demo\swing\Console.py
>> >
>>
>>  Marcos -
>>
>>      Excellent, you're correct, changing the import code in Styles to
>>  avoid pawt fixes the problem.
>>
>>      Hmm... is there a bug then in the pawt code?
>>