For PangoMarkup it is pretty useless currently (segment_info does not contain
anything useful).
Note: this does its job by replacing default behavior.
Source of issue: previous default used either segment_info argument (containing
{"args": args, "environ": os.environ}) or default segment_info, shell renderer
merged default segment_info with .render() argument. Now segment_info is merged
by default and old behavior moved to vim renderer which is the only one that is
designed to use this.
Fixes#391
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).
Custom interval (zero) will be used in tests.
Fixes:
- wrong check for subscribers receiving all events
- missing prev_ext_config setting that meant theme and colorscheme always
reloaded if main configuration was reloaded
Will be used in tests. Allows renderer modules (and extensions) that look like
`foo.bar`: it will import `foo.bar` and not `powerline.renderers.foo.bar` like
before.
Note: current implementation runs `thread.join()` to ensure that thread is not
shut down while updating, but this works only with regular shutdown. If shutdown
is somehow done without triggering VimLeavePre (for vim) threads can be
terminated at any state.
Closes#368Closes#371
Assuming getattr(self, 'update_value') and setattr(self, 'update_value', value)
are atomic. True with cpython unless somebody defined __getattribute__ or
__setattr__.
This is a fix for powerline-daemon: otherwise the first powerline object that
did `watcher(file)` will receive file changed event and other powerline objects
will not.