def write_method_annotation(self, clif, method, writer, skip=False):
     
     prefix = util.namespace_prefix(clif)
     prefix += util.camelcase_to_underscore(clif.prefix).lower()
     
     section_name = prefix + "_" + method.name
     
     writer.writeln("/**")
     
     if section_name in self._sections:
         lines = self._sections[section_name]
         for line in lines:
             writer.writeln(line)
     else:
         if not skip:
             writer.writeln(" * %s: " % section_name)
             writer.writeln(" *")
             if method.scope == Scope.INSTANCE:
                 writer.writeln(" * @self: a #%s instance" % util.clifname(clif))
             for param in method.parameters:
                 writer.writeln(" * @%s: ..." % param.name)
             if method.result is not NULL:
                 writer.writeln(" *")
                 if hasattr(clif, "constructor"):
                     if method is clif.constructor:
                         writer.writeln(" * Return value: a new #%s instance" % util.clifname(clif))
                     else:
                         writer.writeln(" * Return value: ...")
                 else:
                     writer.writeln(" * Return value: ...")
         else:
             writer.writeln(" * %s: (skip)" % section_name)
             writer.writeln(" *")
                     
     writer.writeln(" */")
Esempio n. 2
0
 def _clifname(self, clif):
     
     return util.clifname(clif)