Commit Graph

38 Commits

Author SHA1 Message Date
Foo a718a10591 Add integration tests for tmux segment truncation 2015-05-23 16:11:08 +03:00
ZyX 332a266d87 When testing Vim do not rely on test order and do not save state
This commit refactors `TestVim` test class in test_configuration so that

1. `test_environ_update` does not leave state (value of `powerline_config_paths` 
   global Vim variable) behind other tests can use.
2. `test_local_themes` does not rely on state left from `test_environ_update`, 
   instead using new facility for providing needed value of 
   `Powerline.get_config_paths` call. This facility will be used later in BAR 
   tests.

Ref #1256
2015-01-25 01:58:27 +03:00
ZyX 93acec238e Create vterm-based tests that will test tmux support
It is possible that they eventually will be used also for shells: at least this
makes using postproc.py with all its hacks not needed.
2015-01-17 00:26:11 +03:00
ZyX 347f20d4be Refactor FSTree to not use reduce as it is not present in Python-3
I.e. it is not builtin and requires heavy variant with trying to import it from
functools.
2015-01-07 19:08:38 +03:00
ZyX 45ccbee171 Use singular --*-override form for command-line overrides
Ref #1126
2015-01-07 01:09:52 +03:00
ZyX c868f9c255 Rename `attr` to `attrs`
Fixes #1199
2015-01-06 16:05:01 +03:00
ZyX 48e06cbf9e Refactor weather segment to use KwThreaded segment
Problem: weather segment used to set its state (i.e. user location) once and 
remember it forever.
2014-09-20 13:52: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 0da40f08a5 Fix syntastic error 2014-08-30 17:59:58 +04:00
Matthew M. Keeler 88515ab472 Show Count of Attached Tmux Sessions
- This segment displays the number of attached tmux clients to the
  currently running session.
- The minimum argument is used to specify a threshold for when the
  segment should be visible.

Fixes #661
Closes #662

Conflicts:
	docs/source/index.rst
	powerline/config_files/colorschemes/shell/default.json
	powerline/config_files/colorschemes/shell/solarized.json
	powerline/config_files/colorschemes/tmux/default.json
	powerline/config_files/colorschemes/vim/default.json
	powerline/config_files/colorschemes/vim/solarized.json
	powerline/config_files/colorschemes/wm/default.json
	tests/test_segments.py
2014-08-24 20:56:59 +04:00
ZyX 173c4d6e76 Add internal_ip segment
Closes #857
2014-08-24 01:20:25 +04:00
ZyX ae92d83eae Fix powerline style
Specifically I searched for all lines that are more then one tab off compared to 
the previous line with

    BufGrep /\(^\t\+\)\S.*\n\1\t\t\+/

and replaced them with something more appropriate. Most of time this resulted in 
a few more newlines, but there are cases when I used mixed tabs/spaces 
indentation+alignment.
2014-08-15 20:58:19 +04:00
ZyX 0f4e1bafda Refactor config_mock module to not use globals and fix tests 2014-08-05 13:56:02 +04:00
ZyX 27db44ac7a Implement configuration merging
Fixes #418
2014-08-05 13:56:02 +04:00
ZyX d0c4d4e266 Ignore IOError’s in ConfigLoader.update
Fixes #932
2014-07-26 01:46:54 +04:00
ZyX 0fc7856b1b Rename create_renderer_kwargs to cr_kwargs for consistency 2014-07-10 21:27:41 +04:00
ZyX 289094362e Rename find_config_file to _find_config_file 2014-07-10 21:27:41 +04:00
ZyX c570a98065 Add watcher option
Ref #818
2014-06-28 21:10:15 +04:00
ZyX 6f6c1fb90c Add tests 2014-06-25 20:05:24 +04:00
ZyX 515df615bf Add some basic tests 2014-06-24 23:36:50 +04:00
ZyX ba41cecb72 Add powerline.lib.threaded tests 2014-02-23 15:18:20 +04:00
ZyX a71c49d96b Add tests 2014-01-17 20:51:38 +04:00
ZyX bb0d9028f1 Make sure watcher is not used 2013-11-21 00:23:25 +04:00
ZyX 95d13a334a Test that nothing is reloaded with run_once=True 2013-11-21 00:18:34 +04:00
ZyX b78a8cea14 Fix tmux tests 2013-05-02 15:47:05 +04:00
ZyX af2f8f588b Replace MultiClientWatcher and Powerline threads with ConfigLoader
Also
- move file opening and parsing to ConfigLoader
- add interval configuration
2013-04-06 17:18:25 +04:00
ZyX 33d32498b9 Do not use create_renderer from a separate thread
Also moves functions from tests.test_config_reload to tests.lib.config_mock

Using create_renderer for vim results in vim access from a separate thread.
2013-04-03 06:33:56 +04:00
ZyX c2ceac093f Add replace_item with function, remove os import 2013-03-31 00:02:53 +04:00
ZyX 3ebc16a48c Replace pl.environ/getcwd/home with segment_info 2013-03-30 21:55:00 +04:00
ZyX 29f29213a9 Remove ThreadedSegment.write_lock
Assuming getattr(self, 'update_value') and setattr(self, 'update_value', value) 
are atomic. True with cpython unless somebody defined __getattribute__ or 
__setattr__.
2013-03-30 14:07:24 +04:00
ZyX 6c495374a0 Fix exec call for non-python-2.7 2013-03-24 20:03:09 +04:00
ZyX 1351207462 Some fixes for flake8 2013-03-24 19:59:56 +04:00
ZyX ed435f8063 Add required pl argument to segments
Fixes #340
Ref #330
2013-03-24 19:44:01 +04:00
ZyX 157b849d33 Make weather gradient configurable, add system_load gradient
Also make gradients floating-point and fix #332 by removing “normalized” from 
system_load segment documentation.
2013-03-24 00:55:54 +04:00
ZyX fb2e9b6cdb Test all other segments
Still uncovered: email_imap_alert and now_playing
2013-03-17 21:23:27 +04:00
Kim Silkebækken 111eaa27e8 Combine vim modelines and Python encoding declarations
Ref #314
2013-03-11 10:40:09 +01:00
Kim Silkebækken 6748701fcb Add vim modelines to all Python files
Added with `sed -i '2i# vim:fenc=utf-8:noet' `find -name '*.py'`` and
fixed in a couple of files without the UTF-8 encoding on top.

Ref #314
2013-03-11 08:11:25 +01:00
ZyX c334be416d Add tests.lib module with `replace_*()` with statement functions
Note: there is new problem: now multiprocessing() globals got assigned None
values. It is likely somehow related to extended `sys.modules` utilization
2013-03-03 21:03:26 +01:00