mercurial/registrar.py
changeset 42370 de65ae32b82d
parent 42359 832c59d1196e
child 42596 83666f011679
equal deleted inserted replaced
42369:6310180662f5 42370:de65ae32b82d
   339             pass
   339             pass
   340 
   340 
   341     The first string argument is used also in online help.
   341     The first string argument is used also in online help.
   342 
   342 
   343     Optional argument 'requires' should be a collection of resource names
   343     Optional argument 'requires' should be a collection of resource names
   344     which the template keyword depends on. This also serves as a flag to
   344     which the template keyword depends on.
   345     switch to the new API. If 'requires' is unspecified, all template
       
   346     keywords and resources are expanded to the function arguments.
       
   347 
   345 
   348     'templatekeyword' instance in example above can be used to
   346     'templatekeyword' instance in example above can be used to
   349     decorate multiple functions.
   347     decorate multiple functions.
   350 
   348 
   351     Decorated functions are registered automatically at loading
   349     Decorated functions are registered automatically at loading
   353     decorating in extension.
   351     decorating in extension.
   354 
   352 
   355     Otherwise, explicit 'templatekw.loadkeyword()' is needed.
   353     Otherwise, explicit 'templatekw.loadkeyword()' is needed.
   356     """
   354     """
   357 
   355 
   358     def _extrasetup(self, name, func, requires=None):
   356     def _extrasetup(self, name, func, requires=()):
   359         func._requires = requires
   357         func._requires = requires
   360 
   358 
   361 class templatefilter(_templateregistrarbase):
   359 class templatefilter(_templateregistrarbase):
   362     """Decorator to register template filer
   360     """Decorator to register template filer
   363 
   361