mirror of
https://github.com/powerline/powerline.git
synced 2025-04-08 19:25:04 +02:00
Do not repeat if
more times then needed
This commit is contained in:
parent
38a05b34d7
commit
deee40505d
@ -31,6 +31,10 @@ user = os.environ['USER']
|
|||||||
REFS_RE = re.compile(r'^\[\d+ refs\]\n')
|
REFS_RE = re.compile(r'^\[\d+ refs\]\n')
|
||||||
IPYPY_DEANSI_RE = re.compile(r'\033(?:\[(?:\?\d+[lh]|[^a-zA-Z]+[a-ln-zA-Z])|[=>])')
|
IPYPY_DEANSI_RE = re.compile(r'\033(?:\[(?:\?\d+[lh]|[^a-zA-Z]+[a-ln-zA-Z])|[=>])')
|
||||||
|
|
||||||
|
start_str = 'cd tests/shell/3rd'
|
||||||
|
if shell == 'pdb':
|
||||||
|
start_str = 'class Foo(object):'
|
||||||
|
|
||||||
with codecs.open(fname, 'r', encoding='utf-8') as R:
|
with codecs.open(fname, 'r', encoding='utf-8') as R:
|
||||||
with codecs.open(new_fname, 'w', encoding='utf-8') as W:
|
with codecs.open(new_fname, 'w', encoding='utf-8') as W:
|
||||||
found_cd = False
|
found_cd = False
|
||||||
@ -38,11 +42,7 @@ with codecs.open(fname, 'r', encoding='utf-8') as R:
|
|||||||
for line in (R if shell != 'fish' else R.read().split('\n')):
|
for line in (R if shell != 'fish' else R.read().split('\n')):
|
||||||
i += 1
|
i += 1
|
||||||
if not found_cd:
|
if not found_cd:
|
||||||
found_cd = (
|
found_cd = (start_str in line)
|
||||||
'class Foo(object):' in line
|
|
||||||
if shell == 'pdb' else
|
|
||||||
'cd tests/shell/3rd' in line
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
if 'true is the last line' in line:
|
if 'true is the last line' in line:
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user