home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import re
- from IPython.iplib import InteractiveShell
- PROMPT_RE = re.compile('(^[ \\t]*>>> |^[ \\t]*\\.\\.\\. )')
-
- def prefilter_paste(self, line, continuation):
- if not line:
- return ''
- m = PROMPT_RE.match(line)
- if m:
- return self._prefilter(line[len(m.group(0)):], continuation)
- if line.strip() == '...':
- return self._prefilter('', continuation)
- if line.isspace():
- return ''
- return self._prefilter(line, continuation)
-
-
- def activate_prefilter():
- InteractiveShell.prefilter = prefilter_paste
-
-
- def deactivate_prefilter():
- InteractiveShell.prefilter = InteractiveShell._prefilter
-
- activate_prefilter()
- print '*** Pasting of code with ">>>" or "..." has been enabled.'
-