1721 Commits

Author SHA1 Message Date
ZyX
8d00ba781c Remove unneeded # NOQA comments
It appears that something has changed and it no longer complains about double
declaration in else or except blocks.
2014-09-01 00:25:24 +04:00
ZyX
06211cbe63 Unify imports
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

.
2014-09-01 00:25:24 +04:00
ZyX
545bd6b52f Fix some style errors reported by syntastic in .segments.plugin.ctrlp 2014-08-31 22:09:09 +04:00
ZyX
d952b469d6 Fix syntastic error in powerline.lib.memoize 2014-08-31 21:44:18 +04:00
ZyX
aaed00e078 Fix installation notes location.
These notes are parts of the list entries.
2014-08-31 21:33:56 +04:00
ZyX
0e98bc2d4f Fix style in a number of places
- 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 
  ae92d83eae5142322ff20b9aa81eb53b0b363575, 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.
2014-08-31 21:29:03 +04:00
Nikolai Aleksandrovich Pavlov
a2b58370c4 Merge pull request #1043 from ZyX-I/truncate-expand
Add segment.truncate and segment.expand attributes support
2014-08-30 18:29:28 +04:00
ZyX
2505d0b827 Implement segment truncation
Closes #161 (requires implementation for specific segments though)
2014-08-30 18:22:52 +04:00
ZyX
d6c603daf0 Add support for segment.expand
Closes #154
2014-08-30 18:22:46 +04:00
ZyX
5b038dba82 Use expand key to fill segments 2014-08-30 17:59:58 +04:00
ZyX
bfa335d96a Fix typo in test_configuration.py 2014-08-30 17:59:58 +04:00
ZyX
0da40f08a5 Fix syntastic error 2014-08-30 17:59:58 +04:00
ZyX
875f8e98b1 Update documentation 2014-08-30 17:59:58 +04:00
Nikolai Aleksandrovich Pavlov
2b8e122bc2 Merge pull request #1042 from ZyX-I/remove-filler-segment-type
Remove filler segment type
2014-08-30 16:19:01 +04:00
ZyX
f320fb3df3 Remove filler segment type
It was replaced with `"width": "auto"` and is not used anywhere. I do not even 
know whether it works.
2014-08-30 16:08:30 +04:00
Nikolai Aleksandrovich Pavlov
d714fb0d88 Merge pull request #906 from ZyX-I/uv-watcher
Add pyuv-based watcher
2014-08-30 16:01:07 +04:00
ZyX
8d3376ce07 Ultimately disable pyuv watcher tests 2014-08-30 15:49:50 +04:00
ZyX
560600fca9 Use shutil.rmtree in tests 2014-08-30 15:47:31 +04:00
ZyX
0ee5293e1a Add tests for libuv-based watcher
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.
2014-08-30 15:45:30 +04:00
ZyX
ea3cd2c1c7 Add libuv-based watcher
Fixes #821
2014-08-30 15:45:30 +04:00
ZyX
f5f85ab808 Merge branch 'cyclic-references' into develop 2014-08-30 15:43:10 +04:00
ZyX
cee13ec0e2 Add function that prints cyclic references to powerline.lib.debug 2014-08-30 15:43:00 +04:00
Nikolai Aleksandrovich Pavlov
f076587ed7 Merge pull request #1040 from ZyX-I/no-gradient-raise
Handle errors from Renderer._set_highlighting
2014-08-30 01:56:48 +04:00
ZyX
acd55bbd87 Handle errors from Renderer._set_highlighting
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
2014-08-30 01:03:58 +04:00
Nikolai Aleksandrovich Pavlov
c488b2da7b Merge pull request #1039 from ZyX-I/function-key
Refactor function segments
2014-08-30 00:17:05 +04:00
ZyX
10e8d9bb15 Do not use &> in #!/bin/sh scripts 2014-08-29 23:21:19 +04:00
ZyX
4f5a606ce2 Use “time” for time segment name 2014-08-29 23:13:10 +04:00
ZyX
41476544ca Replace name and module keys with function key
Fixes #1031
2014-08-29 23:13:10 +04:00
ZyX
5bd543ae89 Do not run daemon when running with ONLY_TEST_TYPE=nodaemon 2014-08-29 23:13:10 +04:00
ZyX
9a0e100ca0 Specify -p argument in run function when running shell tests 2014-08-29 23:13:10 +04:00
ZyX
4c95928c96 Split shell tests into files
I am mostly interested in running all python and vim tests separately from other 
tests.
2014-08-29 22:22:39 +04:00
ZyX
c5d15ac8a8 Merge branch 'non-unicode-errors' into develop 2014-08-29 21:06:06 +04:00
ZyX
d138c94704 Fix non-unicode error messages
Ref #645
2014-08-29 21:05:54 +04:00
Nikolai Aleksandrovich Pavlov
d455cec319 Merge pull request #1038 from ZyX-I/ascii-defaults
Use non-unicode defaults in Python code
2014-08-29 20:56:38 +04:00
ZyX
849c34ea72 Replace all unicode defaults with defaults from ASCII theme
Closes #1034
2014-08-29 20:47:44 +04:00
ZyX
e808dd76c4 Specify temp_format argument for weather segment in ascii theme 2014-08-29 20:35:40 +04:00
ZyX
c8d052ad23 Add unicode_text argument for fuzzy_time to top-level themes 2014-08-29 20:33:06 +04:00
ZyX
9fe0b66125 Merge branch 'top-theme-extend' into develop 2014-08-29 20:25:51 +04:00
ZyX
356cb43ea2 Add powerline_segment_datas attribute
Fixes #1035
2014-08-29 20:17:23 +04:00
ZyX
67845dc96e Add documentation for segment attributes 2014-08-29 20:17:23 +04:00
ZyX
cde39f00c4 Fix errors reported by syntastic in powerline.lint.inspect 2014-08-29 19:37:56 +04:00
ZyX
e273287eab Check for presence of powerline_requires_* attributes
In powerline.lint.inspect their value is checked, while in other place `hasattr`
is used. This commit removes this inconsistency.
2014-08-29 19:37:56 +04:00
Nikolai Aleksandrovich Pavlov
96a0af9090 Merge pull request #1036 from ZyX-I/fix-1033
Fix width used for tabline
2014-08-29 19:10:13 +04:00
ZyX
af10fa1e80 Fix typo in mergedicts_copy docstring 2014-08-29 18:40:43 +04:00
ZyX
8fb09bd8b3 Add mergedefaults function that does not override existing keys 2014-08-29 18:40:25 +04:00
ZyX
125f309724 Fix width used for tabline
Fixes #1033
2014-08-29 18:32:58 +04:00
Nikolai Aleksandrovich Pavlov
e609bdf514 Merge pull request #1032 from ZyX-I/skip-vcs-tests
Refactor VCS tests
2014-08-29 00:50:26 +04:00
ZyX
53ab31eeb8 Use setUpClass/tearDownClass to deal with VCS repositories 2014-08-29 00:28:41 +04:00
ZyX
70fabdc02b Use SkipTest for skipping tests 2014-08-29 00:22:28 +04:00
ZyX
323f0c4e22 Use __import__ checks for skipping bzr/mercurial
Closes #1015
2014-08-29 00:22:05 +04:00