Skip to content
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

document templates and make them foolproof in arg_botcmd #930

Open
gbin opened this issue Dec 14, 2016 · 1 comment
Open

document templates and make them foolproof in arg_botcmd #930

gbin opened this issue Dec 14, 2016 · 1 comment

Comments

@gbin
Copy link
Member

gbin commented Dec 14, 2016

    @arg_botcmd('hostname', type=str, template="search")
    @arg_botcmd('hostname2', type=str)
    def ddog_search(self,message, hostname=None, hostname2=None):

        return {'name': hostname,
                       'hostname2': hostname2}

doesn't work

    @arg_botcmd('hostname', type=str)
    @arg_botcmd('hostname2', type=str, template="search")
    def ddog_search(self,message, hostname=None, hostname2=None):

        return {'name': hostname,
                       'hostname2': hostname2}

works

    @arg_botcmd('hostname', type=str, template="search2")
    @arg_botcmd('hostname2', type=str, template="search")
    def ddog_search(self,message, hostname=None, hostname2=None):

        return {'name': hostname,
                       'hostname2': hostname2}

should throw an error !

@zoni
Copy link
Member

zoni commented Dec 14, 2016

Admittedly, this isn't limited to the template parameter alone, but applies to any parameter I believe. The same happens with the unpack_args parameter for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants