Beispiel #1
0
    def make_docstring_text_sb(self, section, level_indent):
        if section.text == None:
            section.text = [] 
        indent = len(section.padding.padding(level_indent))
        #print 'BEFORE:', indent, section.text
        section.text = [self.smart_strip(line, indent) for line in section.text]
        #print 'STRIP:', indent, section.text
        section.text = self.merge_stable_areas(section.text)
        newline = '\n' if not section.text or not section.text[-1].endswith('\n') else ''
        #print 'MERGED:', section.text

        #return '\n'.join(section.padding.padding(level_indent) + line for line in section.text) + newline
        #lines = ' '.join([line.rstrip() for line in section.text])
        #lines = [lines]
        #print 'SECTION:', section.text, lines
        #return '\n'.join(text.format_text(line, len(section.padding.padding(level_indent)), 80) for line in lines) + newline
        return '\n'.join(text.format_text(line, len(section.padding.padding(level_indent)), 80) for line in section.text) + newline
Beispiel #2
0
 def _format_response(self, response, stream):
     if _has_filter_param(self.args)[0]:
         filter_value =_has_filter_param(self.args)[1]
         expression = jmespath.compile(filter_value)
         response = expression.search(response)
     text.format_text(response, stream)
Beispiel #3
0
 def _format_response(self, response, stream):
     if _has_filter_param(self.args)[0]:
         filter_value = _has_filter_param(self.args)[1]
         expression = jmespath.compile(filter_value)
         response = expression.search(response)
     text.format_text(response, stream)