Now imports follow the following structure:
1. __future__ line: exactly one line allowed:
from __future__ import (unicode_literals, division, absolute_import, print_function)
(powerline.shell is the only exception due to problems with argparse).
2. Standard python library imports in a form `import X`.
3. Standard python library imports in a form `from X import Y`.
4. and 5. 2. and 3. for third-party (non-python and non-powerline imports).
6. 3. for powerline non-test imports.
7. and 8. 2. and 3. for powerline testing module imports.
Each list entry is separated by exactly one newline from another import. If
there is module docstring it goes between `# vim:` comment and `__future__`
import. So the structure containing all items is the following:
#!/usr/bin/env python
# vim:fileencoding=utf-8:noet
'''Powerline super module'''
import sys
from argparse import ArgumentParser
import psutil
from colormath.color_diff import delta_e_cie2000
from powerline.lib.unicode import u
import tests.vim as vim_module
from tests import TestCase
.
- Fixes lines where line with N tab indent is followed by a line with N+2 tab
indent or greater (most of such lines were already fixed in
ae92d83eae, but regex used there has one flow:
it does not catches lines where N=0 for which case first `\+` needs to be
replaced with `*`).
- Replace print(…, file=sys.stderr) with sys.stderr.write in powerline-daemon.
Four possible results of running tests (first three are errors):
- “The change to inotify/file2 was not detected” on line 84: most common
- “Spurious change detected” at line 82 (uncommon, usually fixed by sleeping
before running test in do_test_for_change)
- “The change to inotify was not detected” in tree watcher test (e.g. from line
131) (very rare)
- All OK.
It is done by moving appropriate get_highlighting calls into segment.py: here
errors from contents_func are handled as well.
This is a “fix” for #480 that will make such failures cause segment to disappear
with better header which should show segment which caused the error.
Closes#480