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.
shutdown_hook is called after all non-daemon threads exit, but it is needed for
them to exit. Thus I had to use daemon threads in ipython or find some hack to
make .shutdown be called earlier.
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.