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

def IPython::kernel::core::prompts::BasePrompt::__str__ (   self  )  [inherited]

Return a string form of the prompt.

This for is useful for continuation and output prompts, since it is
left-padded to match lengths with the primary one (if the
self.pad_left attribute is set).

Reimplemented in IPython::kernel::core::prompts::Prompt1.

Definition at line 261 of file prompts.py.

00261                      :
        """Return a string form of the prompt.

        This for is useful for continuation and output prompts, since it is
        left-padded to match lengths with the primary one (if the
        self.pad_left attribute is set)."""

        out_str = str_safe(self.p_str)
        if self.pad_left:
            # We must find the amount of padding required to match lengths,
            # taking the color escapes (which are invisible on-screen) into
            # account.
            esc_pad = len(out_str) - len(str_safe(self.p_str_nocolor))
            format = '%%%ss' % (len(str(self.cache.last_prompt))+esc_pad)
            return format % out_str
        else:
            return out_str

    # these path filters are put in as methods so that we can control the
    # namespace where the prompt strings get evaluated
    def cwd_filt(self,depth):


Generated by  Doxygen 1.6.0   Back to index