[Grok-dev] Call for feedbacks : megrok.Resource
Jeroen Michiel
jmichiel at yahoo.com
Thu Feb 18 06:33:32 EST 2010
The configure.zcml is the default one. Do I have to add something there?
What doesn't work is the auto-include of the resources.
with the need() approach, the reset-fonts-grids.css is added in the <head>.
Replacing it with include at class level, it isn't.
a very basic example is:
import grok
from zope.interface import Interface
from megrok import layout, resource
import hurry.yui
class Resourcetest(grok.Application, grok.Container):
pass
class Layout(layout.Layout):
grok.name('layout')
grok.context(Interface)
resource.include(hurry.yui.reset_fonts_grids)
resource.include(hurry.yui.base)
class Index(layout.Page):
pass
----- Original Message ----
From: Souheil CHELFOUH <trollfot at gmail.com>
To: Jeroen Michiel <jmichiel at yahoo.com>
Cc: grok-dev at zope.org
Sent: Thu, 18 February, 2010 12:11:25
Subject: Re: [Grok-dev] Call for feedbacks : megrok.Resource
post me your code and your configure.zcml
let me know what didn't work, I'll have a look
The README.txt of the package shows such a usage.
2010/2/18 Jeroen Michiel <jmichiel at yahoo.com>:
>
> I tried that, but it doesn't seem to work...
> What did I miss?
>
>
> Souheil CHELFOUH wrote:
>>
>> Yes, you can include them like that, directly.
>>
>> 2010/2/18 Jeroen Michiel <jmichiel at yahoo.com>:
>>>
>>> I have been using hurry.yui an hurry.zoperesource until now.
>>> I'm switching hurry.zoperesource for megrok.resource and it still works.
>>>
>>> However, I'm now trying to use the include directive instead of the
>>> need()
>>> approach, but I can't seem to get it working.
>>>
>>> Am I correct that the need() approach can only be used inside methods
>>> (typically update()), but the include directive is meant to be used on
>>> class
>>> level?
>>> So I should be able to replace my previous code:
>>>
>>> class Layout(layout.Layout):
>>> grok.name('layout')
>>> grok.context(Interface)
>>>
>>> def update(self):
>>> hurry.yui.reset_fonts_grids.need()
>>> hurry.yui.base.need()
>>>
>>> with
>>>
>>> class Layout(layout.Layout):
>>> grok.name('layout')
>>> grok.context(Interface)
>>> resource.include(hurry.yui.reset_fonts_grids)
>>> resource.include(hurry.yui.base)
>>>
>>>
>>> Or am I completely off-track, here?
>>>
>>> Thx!
>>>
>>> Souheil CHELFOUH wrote:
>>>>
>>>> Hello friends,
>>>>
>>>> I wondered if any of you (except Christian Klinger, because I already
>>>> know), use the lib megrok.resource, which is a grok layer above
>>>> hurry.resource ?
>>>> Feedbacks would be more than welcome on that strategical library. I
>>>> have already an extension for it, but I need opinions and suggestions,
>>>> first.
>>>> If you could take 5 min to write a note, I'll greatly appreciate it.
>>>>
>>>> - Souheil
>>>> _______________________________________________
>>>> Grok-dev mailing list
>>>> Grok-dev at zope.org
>>>> https://mail.zope.org/mailman/listinfo/grok-dev
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Call-for-feedbacks-%3A-megrok.Resource-tp27625149p27637035.html
>>> Sent from the Grok mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Grok-dev mailing list
>>> Grok-dev at zope.org
>>> https://mail.zope.org/mailman/listinfo/grok-dev
>>>
>> _______________________________________________
>> Grok-dev mailing list
>> Grok-dev at zope.org
>> https://mail.zope.org/mailman/listinfo/grok-dev
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Call-for-feedbacks-%3A-megrok.Resource-tp27625149p27637278.html
> Sent from the Grok mailing list archive at Nabble.com.
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
>
More information about the Grok-dev
mailing list