Commit Graph

640 Commits

Author SHA1 Message Date
Kim Silkebækken 0d3559c869 Increase external IP polling interval to 5 minutes 2013-04-05 15:44:38 +02:00
Kim Silkebækken 17065b4c7e Add timeout to thread join calls to avoid deadlocks 2013-04-05 15:44:01 +02:00
Kim Silkebækken dc1e646308 Merge remote-tracking branch 'zyx-i/fix-391' into develop 2013-04-04 14:49:50 +02:00
ZyX e599691c52 Update only if segment_info is not None 2013-04-03 23:19:35 +04:00
ZyX 878255aff0 Make Tmux and PangoMarkup Renderers merge arguments like shell one
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
2013-04-03 23:09:40 +04:00
Kim Silkebækken 05016c1f4d Merge remote-tracking branch 'zyx-i/dividers' into develop 2013-04-03 08:05:30 +02:00
ZyX 9bd5b3ac37 Fix problems with tests 2013-04-03 09:11:43 +04:00
ZyX ea1e45def4 Fix typo
Fixes #387
2013-04-03 08:51:44 +04:00
ZyX 577a1c0c79 Exchange if and with cr_kwargs_lock 2013-04-03 07:41:48 +04:00
ZyX 2a0e601995 Lock create_renderer_kwargs separately from configs 2013-04-03 07:38:53 +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 b990c920e9 Use clear_events, do not assert. 2013-04-03 06:02:14 +04:00
ZyX de47b76a06 Add more assertAccessEvents
May fix travis build
2013-04-02 19:23:12 +04:00
ZyX 691efbfc9b Also do the same for `last_pipe_status` 2013-04-02 19:06:05 +04:00
ZyX 4e5bd54f79 Fix cwd segment, add use_path_separator option
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.
2013-04-02 19:01:03 +04:00
Kim Silkebækken fd9af0617e Merge remote-tracking branch 'zyx-i/fix-379' into develop 2013-04-02 16:50:20 +02:00
ZyX b47c2fae15 Pass the correct value to _get_user
Fixes #379
2013-04-02 18:40:30 +04:00
ZyX 992e6151eb Remove update_first set from set_state
It is already handled correctly in .render() method
2013-04-02 17:37:03 +04:00
ZyX 66beaaaa9d Replace draw_soft_divider setting with draw_inner_divider
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.
2013-04-02 17:22:55 +04:00
ZyX f15cdd9413 Replace draw_divider setting with draw_(soft|hard)_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.
2013-04-02 17:21:22 +04:00
Kim Silkebækken fcc009a6f5 Merge remote-tracking branch 'mspaulding06/hostname_exclude_domain' into develop
Conflicts:
	powerline/segments/common.py
	tests/test_segments.py
2013-04-02 11:29:08 +02:00
Kim Silkebækken 3d72a227dd Merge remote-tracking branch 'zyx-i/autoreload-config' into develop 2013-04-02 11:03:55 +02:00
ZyX b7c61f8bf6 Handle removed and then added files
Note: if user configuration was removed, but global configuration was not it 
will start tracking global configuration file for changes.
2013-04-02 00:27:54 +04:00
ZyX 4d1dc0658b Remove unexistent kwargs 2013-04-01 00:01:51 +04:00
ZyX 46b5063ea8 Remove unused import 2013-03-31 15:01:06 +04:00
ZyX d1e79000b5 Add tests for reloading theme and colorscheme 2013-03-31 14:57:43 +04:00
ZyX 54471569ab Check whether it switches configuration fine 2013-03-31 14:53:21 +04:00
ZyX 8c3be65bba Added test for colors config reloading 2013-03-31 13:37:07 +04:00
ZyX e35b1541e8 Make it possible to supply different watcher
Used in tests
2013-03-31 13:36:41 +04:00
Matt Spaulding 3a6c0ab8fd Add test for hostname exclude_domain option 2013-03-30 15:32:29 -07:00
Matt Spaulding e03e864f69 Add exclude_domain option to hostname segment
Provides an option to return only the hostname if an fqdn is returned by
socket.gethostname()
2013-03-30 15:09:01 -07:00
ZyX 5a50acf16b Add initial tests for configuration reloading
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).
2013-03-31 00:06:49 +04:00
ZyX c6be4426d3 Fix whitespace errors 2013-03-31 00:03:35 +04:00
ZyX c2ceac093f Add replace_item with function, remove os import 2013-03-31 00:02:53 +04:00
ZyX 26412c3aff Add watching interval customization, some fixes
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
2013-03-30 23:57:21 +04:00
ZyX 3ebc16a48c Replace pl.environ/getcwd/home with segment_info 2013-03-30 21:55:00 +04:00
ZyX 854216810e Change spaces in vim renderer 2013-03-30 21:52:05 +04:00
ZyX 3061738506 Collect all renderer options into one dictionary 2013-03-30 21:51:30 +04:00
ZyX 452e7780eb Add extension to prefix when logging 2013-03-30 21:50:11 +04:00
ZyX 90c8020e09 Use monotonic clock, not time.time 2013-03-30 18:12:55 +04:00
ZyX a31d6f00a7 Rename update_state to branch in powerline.segments.vim.BranchSegment 2013-03-30 16:58:18 +04:00
ZyX 388cccb3cf Add write_lock to KwThreadedSegment
Otherwise it is not safe to use. ThreadedSegment does not need write locks.

New variant spends much less time locked in both threads
2013-03-30 16:57:04 +04:00
ZyX e2b13d9bba Also catch keyboard interrupts while updating
This will skip segments and issue a warning to log.
2013-03-30 16:54:43 +04:00
ZyX bc1a3e4c1d Allow overriding renderer module with any module
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.
2013-03-30 16:53:04 +04:00
ZyX 34c775f628 Fix problem with updating value: it was not updated in a thread 2013-03-30 16:51:04 +04:00
ZyX 655549440b Use daemon threads by default
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 #368
Closes #371
2013-03-30 15:54:33 +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 ff6fd64339 Only access watcher through proxy
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.
2013-03-30 13:56:03 +04:00
ZyX 38081239f2 Remove self.sleep call 2013-03-26 21:31:05 +04:00
ZyX ee23c57d6a Purge configs in another place
Loading main configuration does not necessary imply loading other configurations
2013-03-26 18:37:29 +04:00