Jeroen Vloothuis <[EMAIL PROTECTED]> writes: > To make this better Martijn and I came to this proposal: > > from kss.base import core > > class SomeKSSView(KSSView): > def update_something(self): > core.replaceInnerHTML(self.commands, '#some-node', 'some content') > return self.render() > > This makes it explicit where the code is implemented (see the import).
+1 > it would both work with a pure Python implementation (for kss.base) +1 > and makes the system a bit simpler (conceptually). +1 But, I still think the proposal can be significantly improved. It's just ugly to have to pass "self" (or something inside of self) for every single command that you call. Though I have never, in my career, suggested such a thing, I'm going to make a strong suggestion that we consider multiple inheritance: class SomeKSSView(KSSView, jQueryCommands): def update_something(self): # The KSSView itself comes with the "core" commands already self.replaceInnerHTML('#some-node', 'some content') # The jQueryCommands superclass provides some other functions self.animate('{scrollTop: targetOffset}', 1000) return self.render() I think this would make for far, far clearer code. Right at the top of a KSS class, you get to see what command sets it requires (instead of having to read the whole way through it). And, those commands can be used without having to pass "self" or something inside of "self". I think that this achieves all of the goals that I +1'd up above, and makes things even cleaner in addition. -- Brandon Craig Rhodes [EMAIL PROTECTED] http://rhodesmill.org/brandon _______________________________________________ Kss-devel mailing list Kss-devel@codespeak.net http://codespeak.net/mailman/listinfo/kss-devel