errbot icon indicating copy to clipboard operation
errbot copied to clipboard

document templates and make them foolproof in arg_botcmd

Open gbin opened this issue 9 years ago • 1 comments

    @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 !

gbin avatar Dec 14 '16 19:12 gbin

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.

zoni avatar Dec 14 '16 21:12 zoni