Logo Search packages:      
Sourcecode: ipython version File versions  Download package

def IPython::testing::plugin::ipdoctest::IPDocTestParser::_check_prompt_blank (   self,
  lines,
  indent,
  name,
  lineno,
  ps1_len 
) [private]

Given the lines of a source string (including prompts and
leading indentation), check to make sure that every prompt is
followed by a space character.  If any line is not followed by
a space character, then raise ValueError.

Note: IPython-modified version which takes the input prompt length as a
parameter, so that prompts of variable length can be dealt with.

Definition at line 698 of file ipdoctest.py.

00698                                                                        :
        """
        Given the lines of a source string (including prompts and
        leading indentation), check to make sure that every prompt is
        followed by a space character.  If any line is not followed by
        a space character, then raise ValueError.

        Note: IPython-modified version which takes the input prompt length as a
        parameter, so that prompts of variable length can be dealt with.
        """
        space_idx = indent+ps1_len
        min_len = space_idx+1
        for i, line in enumerate(lines):
            if len(line) >=  min_len and line[space_idx] != ' ':
                raise ValueError('line %r of the docstring for %s '
                                 'lacks blank after %s: %r' %
                                 (lineno+i+1, name,
                                  line[indent:space_idx], line))


SKIP = doctest.register_optionflag('SKIP')


Generated by  Doxygen 1.6.0   Back to index