0.9.8 resources.ResourcesApp.register breaks tw.tools

2 views
Skip to first unread message

alexbod...@gmail.com

unread,
Sep 19, 2009, 9:59:42 PM9/19/09
to toscawidge...@googlegroups.com

hello friends,

a problem with last ToscaWidgets upgrade.

resources.ResourcesApp.register requires an additional arg variant_mapping, which tw.mootools doesn't pass at the moment.

--
alex

Diez B. Roggisch

unread,
Sep 19, 2009, 11:22:47 PM9/19/09
to toscawidge...@googlegroups.com
alexbod...@gmail.com schrieb:

That would be strange, as the variant_mapping is just a re-naming of the
former "filename".

But what's missing is a new first parameter, the widget itself.

Maybe you can fix that for mootools? BTW, why are they messing with
resourcesapp anyway, that's pretty much TW-internals?

Diez


alexbod...@gmail.com

unread,
Sep 20, 2009, 4:47:34 AM9/20/09
to toscawidge...@googlegroups.com
hi diez,

apparently, tw.mootools.base.MootoolsLink __init__ could call it's super __init__ instead of it's entire first 6 lines.

this works with tw 0.9.7, but fails dreadfully with tw 0.9.8.
worth mentioning, that the Link.__init__ doesn't get invoked at all, even though i've put the super __init__ call.

all i can suspect, is that the problem is related to the usage of MootoolsLink as inheriting from it and from jslink, making double inheritance from link. what would you think?

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "ToscaWidgets-discuss" group.
> To post to this group, send email to toscawidge...@googlegroups.com
> To unsubscribe from this group, send email to toscawidgets-dis...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/toscawidgets-discuss?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>

--
alex

alexbod...@gmail.com

unread,
Sep 20, 2009, 5:04:38 AM9/20/09
to toscawidge...@googlegroups.com
i have eliminated the double inheritance, so that MootoolsLink inherits now from jslink, but i still get a crash as follows:

File '/remotehome/alex/tg2env/resheteva_elixir/resheteva/controllers/root.py', line 16 in <module>
from tgext.pages.controllers import PagesController
File '/remotehome/alex/tg2env/package-dev/tgextpages/tgext/pages/controllers/__init__.py', line 1 in <module>
from pages import PagesController
File '/remotehome/alex/tg2env/package-dev/tgextpages/tgext/pages/controllers/pages.py', line 12 in <module>
from tgext.pages.controllers.admin import AdminController
File '/remotehome/alex/tg2env/package-dev/tgextpages/tgext/pages/controllers/admin/__init__.py', line 1 in <module>
from tgext.pages.controllers.admin.root import AdminController
File '/remotehome/alex/tg2env/package-dev/tgextpages/tgext/pages/controllers/admin/root.py', line 23 in <module>
from tgext.pages.controllers.admin.auth import AdminAuthController
File '/remotehome/alex/tg2env/package-dev/tgextpages/tgext/pages/controllers/admin/auth.py', line 17 in <module>
from tgext.pages.core.adminauthfields import auth_actions_form
File '/remotehome/alex/tg2env/package-dev/tgextpages/tgext/pages/core/adminauthfields.py', line 15 in <module>
from tgext.pages.resources import tooltips_css
File '/remotehome/alex/tg2env/package-dev/tgextpages/tgext/pages/resources.py', line 2 in <module>
from tw.mootools.base import moo_core_js_compressed, moo_more_js_compressed
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/tw.mootools-0.9.7-py2.5.egg/tw/mootools/__init__.py', line 1 in <module>
from tw.mootools.base import (moo_core_js, moo_core_js_compressed,
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/tw.mootools-0.9.7-py2.5.egg/tw/mootools/base.py', line 83 in <module>
moo_core_js_compressed = MootoolsCoreLink(suffix='yc')
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/ToscaWidgets-0.9.8dev_20090828-py2.5.egg/tw/core/util.py', line 133 in wrapper
output = func(self, *args, **kw)
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/tw.mootools-0.9.7-py2.5.egg/tw/mootools/base.py', line 40 in __init__
super(MootoolsLink, self).__init__(*args, **kw)
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/ToscaWidgets-0.9.8dev_20090828-py2.5.egg/tw/core/util.py', line 133 in wrapper
output = func(self, *args, **kw)
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/ToscaWidgets-0.9.8dev_20090828-py2.5.egg/tw/core/resources.py', line 416 in __init__
self, modname, self.filename
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/ToscaWidgets-0.9.8dev_20090828-py2.5.egg/tw/core/resources.py', line 114 in register
if widget not in self._widgets:
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/ToscaWidgets-0.9.8dev_20090828-py2.5.egg/tw/core/resources.py', line 442 in __eq__
return getattr(other, "link", None) == self.link
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/tw.mootools-0.9.7-py2.5.egg/tw/mootools/base.py', line 51 in _get_link
return tw.

--
alex

alexbod...@gmail.com

unread,
Sep 20, 2009, 10:39:59 AM9/20/09
to toscawidge...@googlegroups.com
sorry, my previous traceback was incomplete. here's the good one:
return tw.framework.url(self._link or '')
File '/remotehome/alex/tg2env/lib/python2.5/site-packages/ToscaWidgets-0.9.8dev_20090828-py2.5.egg/tw/mods/base.py', line 114 in url
return ''.join([script_name, prefix, url])
TypeError: sequence item 2: expected string, VariantedUrl found
--
alex

Diez B. Roggisch

unread,
Sep 20, 2009, 12:19:06 PM9/20/09
to toscawidge...@googlegroups.com
alexbod...@gmail.com schrieb:

> i have eliminated the double inheritance, so that MootoolsLink inherits
> now from jslink, but i still get a crash as follows:

<snip/>

You should get rid of the code that overloads getting and setting the link.

The overall problem stems from mootools adding a nice feature that
enables you to select a version, and a variant (min, packed, debug,
normal). At least the latter is now officially supported in TW 0.9.8 -
maybe you could try & change mootools to work with that.

Diez

alexbod...@gmail.com

unread,
Sep 20, 2009, 9:57:10 PM9/20/09
to toscawidge...@googlegroups.com
hi diez,


On Sun, Sep 20, 2009 at 19:19, Diez B. Roggisch <de...@web.de> wrote:
>
> alexbod...@gmail.com schrieb:
>> i have eliminated the double inheritance, so that MootoolsLink inherits
>> now from jslink, but i still get a crash as follows:
>
> <snip/>
>
> You should get rid of the code that overloads getting and setting the link.

right, now it works as before, i think. thank you very much.


>
> The overall problem stems from mootools adding a nice feature that
> enables you to select a version, and a variant (min, packed, debug,
> normal). At least the latter is now officially supported in TW 0.9.8 -
> maybe you could try & change mootools to work with that.

the best example case for this idea might be tw.jquery, that has various versions and compression types in tw.
mootools might follow, by also adding some other compression types. as you see, mootools sources are also split by *.core and *.more. though to my understanding there's only one file for each, this should be taken into consideration as an example where the version is in the middle of the filename for making the variant mechanism work here too (this may work already, i only didn't find where).

alexbod...@gmail.com

unread,
Sep 20, 2009, 10:00:36 PM9/20/09
to toscawidge...@googlegroups.com
i'd attach the changed file, should someone need a quick fix.

--
alex

base.py

percious

unread,
Sep 21, 2009, 4:59:46 PM9/21/09
to ToscaWidgets-discuss
This also breaks tw.yui, and tw.timeplot, and anything that uses my
versioning system.

um, what should we do here? We are going to have to fix all these
packages in order to do a proper release.

cheers.
-chris

On Sep 20, 10:19 am, "Diez B. Roggisch" <de...@web.de> wrote:
> alexbodn.gro...@gmail.com schrieb:

percious

unread,
Sep 21, 2009, 5:01:10 PM9/21/09
to ToscaWidgets-discuss
See this blog post:
http://percious.com/blog/archives/20

On Sep 20, 8:00 pm, alexbodn.gro...@gmail.com wrote:
> i'd attach the changed file, should someone need a quick fix.
>
>
>
>
>
> On Mon, Sep 21, 2009 at 04:57,  <alexbodn.gro...@gmail.com> wrote:
> > hi diez,
>
> > On Sun, Sep 20, 2009 at 19:19, Diez B. Roggisch <de...@web.de> wrote:
>
> >> alexbodn.gro...@gmail.com schrieb:
>
> >>> i have eliminated the double inheritance, so that MootoolsLink inherits
> >>> now from jslink, but i still get a crash as follows:
>
> >> <snip/>
>
> >> You should get rid of the code that overloads getting and setting the
> >> link.
>
> > right, now it works as before, i think. thank you very much.
>
> >> The overall problem stems from mootools adding a nice feature that
> >> enables you to select a version, and a variant (min, packed, debug,
> >> normal). At least the latter is now officially supported in TW 0.9.8 -
> >> maybe you could try & change mootools to work with that.
>
> > the best example case for this idea might be tw.jquery, that has various
> > versions and compression types in tw.
> > mootools might follow, by also adding some other compression types. as you
> > see, mootools sources are also split by *.core and *.more. though to my
> > understanding there's only one file for each, this should be taken into
> > consideration as an example where the version is in the middle of the
> > filename for making the variant mechanism work here too (this may work
> > already, i only didn't find where).
>
> >> Diez
>
> >> >
> > --
> > alex
>
> --
> alex
>
>  base.py
> 4KViewDownload
>
>  smime.p7s
> < 1KViewDownload

percious

unread,
Sep 21, 2009, 6:05:22 PM9/21/09
to ToscaWidgets-discuss
Okay,

I've fixed tw.timeplot, tw.yui, tw.dojo, and tw.timeline. Roughly,
they all needed to be changed in the following ways:

http://toscawidgets.org/hg/tw.yui/rev/8349d193ac4f

i can take a look at tw.mootools next, unless jon gets to it first.

cheers.
-chris

alexbod...@gmail.com

unread,
Sep 21, 2009, 9:16:43 PM9/21/09
to toscawidge...@googlegroups.com
hi percious,

there's an attempt to enclose the versioning etc in the newer tw, so you wouldn't probably reimplement it for each library.
however i didn't personally check it, look at the code for the *variant.

also, for tw.mootools at least, i had to remove more stale and redundant code, in order to make it work. see my attachment for example.

percious

unread,
Sep 22, 2009, 11:21:46 AM9/22/09
to ToscaWidgets-discuss
1) From the bundle you provided, it looks like you have removed the
versioning abilities from mootools. I'd like to have Jon take a look
at it and make sure it still works.

2) I see the attempt to enclose versioning within the TW core, but I
have not seen documentation for this yet, perhaps you could point me
to
it's location?

3) Guys, we really need a release. Have we banged on 0.9.8 enough to
put one out?

cheers.
-chris
> alex
>
>  smime.p7s
> < 1KViewDownload

alexbod...@gmail.com

unread,
Sep 22, 2009, 11:39:14 AM9/22/09
to toscawidge...@googlegroups.com

On Tue, Sep 22, 2009 at 18:21, percious <ch...@percious.com> wrote:
>
> 1) From the bundle you provided, it looks like you have removed the
> versioning abilities from mootools.  I'd like to have Jon take a look
> at it and make sure it still works.

the version and part args are still honored, and the name is built by the filename property.

>
> 2) I see the attempt to enclose versioning within the TW core, but I
> have not seen documentation for this yet, perhaps you could point me
> to
> it's location?

i missed the way the filename is being made in tw, hence i left the tw.mootools filename property in place. for me it works, again.

percious

unread,
Sep 22, 2009, 11:43:59 PM9/22/09
to ToscaWidgets-discuss
> > 2) I see the attempt to enclose versioning within the TW core, but I
> > have not seen documentation for this yet, perhaps you could point me
> > to
> > it's location?
>
> i missed the way the filename is being made in tw, hence i left the tw.mootools filename property in place. for me it works, again.
>
right, what I am looking for is a document that describes the new way
of versioning, so I can change tw.yui, dojo, timeline, timeplot over
to it, and not have to maintain so much code.

cheers.
-chris

Diez B. Roggisch

unread,
Sep 23, 2009, 2:36:42 AM9/23/09
to toscawidge...@googlegroups.com
percious schrieb:

I don't know where Alex got the impression that there is already
versioning support - at least I haven't seen such a thing, and also not
worked on it.

All I said was that this might be a worthy addition, so that not all
packages implement this themselves & need to poke into internals they
shouldn't care about.

OTOH, for jquery I ditched versioning in the package totally, and
instead created packages that reflect the version they support. It was
mostly because of the heavy plugin-based architecture, but it might be
worth thinking about for the others as well.

Diez

alexbod...@gmail.com

unread,
Sep 23, 2009, 7:22:56 AM9/23/09
to toscawidge...@googlegroups.com

On Wed, Sep 23, 2009 at 09:36, Diez B. Roggisch <de...@web.de> wrote:
>
> percious schrieb:
>>>> 2) I see the attempt to enclose versioning within the TW core, but I
>>>> have not seen documentation for this yet, perhaps you could point me
>>>> to
>>>> it's location?
>>> i missed the way the filename is being made in tw, hence i left the tw.mootools filename property in place. for me it works, again.
>>>
>> right, what I am looking for is a document that describes the new way
>> of versioning, so I can change tw.yui, dojo, timeline, timeplot over
>> to it, and not have to maintain so much code.
>
> I don't know where Alex got the impression that there is already
> versioning support - at least I haven't seen such a thing, and also not
> worked on it.

no, the version (and the compression method) were both in tw.mootools, and the compression suffix may now be added by tw. just that mootools have additional compression methods, that should be made available either centrally by tw, or per project, like tw.mootools.


>
> All I said was that this might be a worthy addition, so that not all
> packages implement this themselves & need to poke into internals they
> shouldn't care about.
>
> OTOH, for jquery I ditched versioning in the package totally, and
> instead created packages that reflect the version they support. It was
> mostly because of the heavy plugin-based architecture, but it might be
> worth thinking about for the others as well.
>
> Diez
>

Reply all
Reply to author
Forward
0 new messages