diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-09-14 16:34:07 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-09-14 16:42:44 +0300 |
commit | 65e983f916c022329f41054c72ca552faf372941 (patch) | |
tree | be2e2380b20ac115946c2e43e10bb900d6ee67a6 /contrib/python/ipython/py3/IPython/core/splitinput.py | |
parent | abdb8cda9345851fdea911b3016fafc5780c12f3 (diff) | |
download | ydb-65e983f916c022329f41054c72ca552faf372941.tar.gz |
Intermediate changes
commit_hash:315a764ebe0b22f720e1d1f1147e3f2ab88f6ea4
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 0cd70ec910..33e462b3b8 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) + ">" |