I added this to Command:
@classproperty
def application(cls):
# avoid circular import
from .interface import Application
return Application()
The idea is it would allow me to create a commands.py script and add some commands and then do this at the bottom:
from captain import Command
class Default(Command):
pass
if __name__ == "__main__":
Default.application()
And it would work as expected and I wouldn't have to import application also. But it got into infinite recursion loop, I'm not sure why and I don't have the time to look into it right now. It looks like it was something with using the AST to get docblocks but I'm not sure why.
I added this to
Command:The idea is it would allow me to create a
commands.pyscript and add some commands and then do this at the bottom:And it would work as expected and I wouldn't have to import
applicationalso. But it got into infinite recursion loop, I'm not sure why and I don't have the time to look into it right now. It looks like it was something with using the AST to get docblocks but I'm not sure why.