Skip to content

Command.application syntactic sugar that doesn't work #100

Description

@Jaymon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions