diff options
| author | Alexander Smirnov <[email protected]> | 2024-09-16 10:32:31 +0000 |
|---|---|---|
| committer | Alexander Smirnov <[email protected]> | 2024-09-16 10:32:31 +0000 |
| commit | 52a419c59b731f4c91b5e597e31777d824685fbe (patch) | |
| tree | 27ca267e7fb3893d72a5c247639e1bc65fe47176 /contrib/python/ipython/py3/IPython/core/splitinput.py | |
| parent | efd8a439c7785df17481842ece1875fdd3644140 (diff) | |
| parent | 7c696077507829e429a5c82f061c0664d183bc3d (diff) | |
Merge branch 'rightlib' into mergelibs-240916-1031
Diffstat (limited to 'contrib/python/ipython/py3/IPython/core/splitinput.py')
| -rw-r--r-- | contrib/python/ipython/py3/IPython/core/splitinput.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/python/ipython/py3/IPython/core/splitinput.py b/contrib/python/ipython/py3/IPython/core/splitinput.py index 0cd70ec9100..33e462b3b80 100644 --- a/contrib/python/ipython/py3/IPython/core/splitinput.py +++ b/contrib/python/ipython/py3/IPython/core/splitinput.py @@ -76,7 +76,7 @@ def split_user_input(line, pattern=None): # print('line:<%s>' % line) # dbg # print('pre <%s> ifun <%s> rest <%s>' % (pre,ifun.strip(),the_rest)) # dbg - return pre, esc or '', ifun.strip(), the_rest.lstrip() + return pre, esc or "", ifun.strip(), the_rest class LineInfo(object): @@ -107,11 +107,15 @@ class LineInfo(object): the_rest Everything else on the line. + + raw_the_rest + the_rest without whitespace stripped. """ def __init__(self, line, continue_prompt=False): self.line = line self.continue_prompt = continue_prompt - self.pre, self.esc, self.ifun, self.the_rest = split_user_input(line) + self.pre, self.esc, self.ifun, self.raw_the_rest = split_user_input(line) + self.the_rest = self.raw_the_rest.lstrip() self.pre_char = self.pre.strip() if self.pre_char: @@ -136,3 +140,6 @@ class LineInfo(object): def __str__(self): return "LineInfo [%s|%s|%s|%s]" %(self.pre, self.esc, self.ifun, self.the_rest) + + def __repr__(self): + return "<" + str(self) + ">" |
