[Grok-dev] Re: more changes in martian, grokcore.component

Philipp von Weitershausen philipp at weitershausen.de
Sat Jun 7 05:51:32 EDT 2008

Martijn Faassen wrote:
> I've just released Martian 0.10. Martian 0.10 follows up on some recent 
> Martian changes. What's new:
> * new tutorial content, replacing the old README.txt. Those tests have 
> moved to core.txt. The new tutorial is shorter and should explain 
> Martian better to beginners.

Excellent idea.

> * new directives: martian.component, replaces component_class 
> class-level attribute on grokkers. martian.priority replaces priority 
> class level attribute on grokkers, and martian.directive replaces the 
> new 'directives' list. It takes a directive (class) as an argument, and 
> optionally the further parameters to bind() (name, default, get_default).
> * combined martian.GrokRegistry that makes martian more easy to use from 
> Python code.
> The new directives allow you to write a grokker in the same style as the 
> classes you're actually grokking:
> class FooGrokker(martian.ClassGrokker):
>     martian.component(Foo)
>     martian.directive(name)
>     martian.directive(context, get_default=default_context)
>     def execute(self, class_, name, context, **kw):
>          ...

Excellent! I really like how we've evolved the spelling of the directive 
binding over time. Also, more of eating our dogfood!

> I've also updated grokcore.component trunk to work with the new version 
> of Martian. I haven't updated the Grok trunk yet. Someone else will have 
> to update five.grok; the changes aren't difficult but if you have 
> questions, please ask them here!

I can take care of five.grok and some of the megrok packages that might 
be affected (as I've done on all previous refactorings already). Let me 
know if you need help with updating Grok.

> P.S. yes, an actual feature version bump to martian 0.10, we shouldn't 
> be doing major changes to the way martian works in the third number!

Yeah, I suppose we should've made a proper version bump for the first 
directive change as well. Actually, looking at Martian 0.9.x releases, 
almost every one was a feature release...

More information about the Grok-dev mailing list