diff options
| author | Maxim Yurchuk <[email protected]> | 2024-09-16 16:22:11 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-09-16 16:22:11 +0300 |
| commit | 3d9a39603bc00c77c41243d12a98cac4c8e021af (patch) | |
| tree | 09f28df05a8becc3f370e038f3342e22df08eab1 /contrib/python/ipython/py3/IPython/core/splitinput.py | |
| parent | a179d17fdc3dd8f6aea1e8a0224e7a537bea168d (diff) | |
| parent | 15639a8621f3301c1770fedd20c86c6d2090a754 (diff) | |
Merge pull request #9292 from ydb-platform/mergelibs-240916-1031
Library import 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) + ">" |
