New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The instance of default appModule needs to be easy accessible #316
Comments
Comment 1 by jteh on 2009-05-16 06:27 |
Comment 2 by aleksey_s (in reply to comment 1) on 2009-05-16 07:08
Don't sure. explanation follows.
What a painfull solution :)
Making yet another level willl not simplify things. Why we can't modify the default appModule class? then modifications/bindings will affect each appModule, as it is subclass of default. So accessing default appModule is actually needed. |
Comment 3 by jteh (in reply to comment 2) on 2009-05-17 00:05
Why not? Also, note that the default appModule used to be another level, so we're basically just reintroducing something we removed, bt using it for a different purpose.
This actually isn't true. When you bind a key on a subclass, the keyMap dict is copied, so you only get the bindings from the default appModule class at the time the copy occurred. We might be able to work around this by modifying the code to search all bases for scripts. I still believe reintroducing another level is probably the more correct solution; this one is pretty hacky.
Previously, appModuleHandler.default accessed the instance of the default appModule. You're talking about the class, which is a rather different thing; there is no longer an instance of the default appModule. Btw, you can access the class via |
Comment 4 by aleksey_s (in reply to comment 3) on 2009-05-17 07:11
Ok then, why we removed it earlier? :-)
Agree. I've just suggested approach, which will not affect all existing appModules. If we'll reintroduce global level, appModules will be not subclasses of default.
I've just nodiced this when revieved appModuleHandler.
Sure. So target of this ticket is feature to dynamically bind/unbind scripts on global level as well as another levels. |
Comment 5 by mdcurran on 2011-04-06 01:54 |
Comment 6 by jteh on 2011-04-07 04:10 |
Reported by aleksey_s on 2009-05-15 16:28
Help on the appModuleHandler says, that @var appModuleHandler.default holds the instance of default appModule, but it isn't so.
steps to reproduce
import appModuleHandler
appModuleHandler.default
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'default'
The text was updated successfully, but these errors were encountered: