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.
cwd segment was not drawing inner separators because of new default for
multisegment functions. use_path_separator was added because current variant
looks bad for my taste.
If weather or system_load segments were moved to the left draw_soft_divider
variant resulted in incorrect renderring. Thus it was replaced by
draw_inner_divider.
Previous variant was bad because
1. draw_divider only applied to soft dividers. Hard dividers were always drawn
2. But there was a hack with width=auto segments: for this segments draw_divider
setting applied always.
Now there are no additional dependencies: draw_*_divider applies no matter what
other properties of the segment are.
Currently only:
- Test for not reloading configuration if run_once is not True
- Test for reloading main configuration and other configurations triggered by
changes in main configuration file
TODO: tests for all other configuration files reloading (colors, colorscheme,
theme).
Assuming getattr(self, 'update_value') and setattr(self, 'update_value', value)
are atomic. True with cpython unless somebody defined __getattribute__ or
__setattr__.
Target: with long-living Powerline objects periodically reload configuration
recreating renderer. Use file watchers to watch for configuration. Configuration
should be able to be safely reloaded in non-blocking mode in a separate thread
up to the time when it comes to recreating renderer.
This commit does not add anything that actually reloads the configuration,
multiple runs of .create_renderer were not tested.
Those exceptions are now handled and logged at top level, thus no need to handle
them in segment.
Ref #330, it is now fixed for zsh/zpython
Note: do not use zsh/zpython + python3, it does not work properly, even though
this changeset contains fixes for it as well
Fixes#360
NOTE: Documentation now gets attached to *classes*, not actual segments. Hiding
away classes (by changing their names to start with `_`) and/or doing
self.__doc__ = self.__class__.__doc__
does not work (hiding classes only hides documentation completely). I am
not familiar with sphinx enough to say how this should be fixed.
Ref #168