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
No need to bother both developers (that need to create class names compatible
with file name, which is not obvious if not looking into main Powerline class)
and computer (that needs to recompute class name each time) if it is possible to
bother only developers (or only computer, but this contributes to higher startup
times).
About not obvious: when you look into zsh_prompt.py and see only
ZshPromptRenderer name you only think that powerline upstream is following
strict code style. You don’t think there is a technical reason for such naming,
like you don’t think there is technical reason for having blank lines. When you
look into zsh_prompt.py and see `renderer = ZshPromptRenderer` it is obvious
that there is technical reason for writing code this way because new variable is
never used in the module itself.
Dynamic configuration tests. Purpose: make sure that default configuration does
not throw. Tests catch only very trivial problems (like missing imports after
refactoring)
Changes:
- Add main configuration, colors.json, almost full themes and colorschemes
checks
- Make powerline.lint.check return whether it had problems
- Make powerline-lint fail if .check reported problems
- Make tests run powerline-lint
- Add the script to the list of the installed scripts
Fixes#278