Ejemplo n.º 1
0
    def to_rst(self, indent=4, prefix=''):
        """ Outputs field in rst using as items in an list.

        Arguments
        ---------
        indent : int
            The indent to use for the decription block.

        prefix : str
            The prefix to use. For example if the item is part of a numbered
            list then ``prefix='# '``.

        Example
        -------


        Note
        ----
        The field descrption is reformated into a line.

        """
        indent_str = ' ' * indent
        rst_pattern = '{0}{1}**{2}**{3}' if is_empty(self.desc[0]) else \
                       '{0}{1}**{2}** -- {3}'
        description = '' if is_empty(self.desc[0]) else \
                      ' '.join(remove_indent(self.desc))
        return [rst_pattern.format(indent_str, prefix, self.name, description)]
Ejemplo n.º 2
0
Archivo: fields.py Proyecto: 5n1p/enaml
    def to_rst(self, indent=4, prefix=''):
        """ Outputs field in rst using as items in an list.

        Arguments
        ---------
        indent : int
            The indent to use for the decription block.

        prefix : str
            The prefix to use. For example if the item is part of a numbered
            list then ``prefix='# '``.

        Example
        -------


        Note
        ----
        The field descrption is reformated into a line.

        """
        indent_str = ' ' * indent
        rst_pattern = '{0}{1}**{2}**{3}' if is_empty(self.desc[0]) else \
                       '{0}{1}**{2}** -- {3}'
        description = '' if is_empty(self.desc[0]) else \
                      ' '.join(remove_indent(self.desc))
        return [rst_pattern.format(indent_str, prefix, self.name, description)]
Ejemplo n.º 3
0
Archivo: fields.py Proyecto: 5n1p/enaml
 def to_rst(self, indent=4, prefix=''):
     indent_str = ' ' * indent
     _type = '' if self.signature == '' else '({0})'.format(self.signature)
     rst_pattern = '{0}{1}**{2}** {3}{4}' if is_empty(self.desc[0]) else \
                    '{0}{1}**{2}** {3} -- {4}'
     description = '' if is_empty(self.desc[0]) else \
                 ' '.join(remove_indent(self.desc))
     return [rst_pattern.format(indent_str, prefix, self.name, _type, description)]
Ejemplo n.º 4
0
 def to_rst(self, indent=4, prefix=''):
     indent_str = ' ' * indent
     _type = '' if self.signature == '' else '({0})'.format(self.signature)
     rst_pattern = '{0}{1}**{2}** {3}{4}' if is_empty(self.desc[0]) else \
                    '{0}{1}**{2}** {3} -- {4}'
     description = '' if is_empty(self.desc[0]) else \
                 ' '.join(remove_indent(self.desc))
     return [
         rst_pattern.format(indent_str, prefix, self.name, _type,
                            description)
     ]