649 Commits

Author SHA1 Message Date
ZyX
71329cdb5d Add gradient for cpu_load_percent
Note: no changes to colorschemes: no cpu_load_percent in colorscheme
2013-04-08 08:04:22 +04:00
ZyX
14b31eca35 Make dummy cpu_load_percent also ThreadedSegment
It is the easiest way to make documentation identical when created on a system 
with and without psutil module and deduplicate docstrings
2013-04-07 19:01:54 +04:00
ZyX
f3ce370566 Make cpu_load_percent segment threaded
interval=0.5 means that it will block for 0.5 seconds which is bad. With 
             threading it blocks only the separate thread, and it does not hold 
             GIL (uses regular time.sleep to wait) in this case which is fine.
interval=0.05 means that it will report almost random value.
interval=None means that (assuming psutil.cpu_percent is called only by this 
              segment) it will report CPU load percent measured between two 
              subsequent .cpu_load_percent calls or cpu_load_percent call and 
              module import. It is used for update method to get immediate 
              result in case update_first is True.
2013-04-07 18:52:49 +04:00
Kim Silkebækken
2685f61e88 Merge branch 'various-improvements' into develop 2013-04-05 16:22:46 +02:00
Kim Silkebækken
5ff80ee206 Merge branch 'feature/shortened-uptime' into develop 2013-04-05 16:22:38 +02:00
Kovid Goyal
f1286a7bc1 Rename time.py to monotonic.py
This makes it possible to run modules in the lib/ directory standalone.
2013-04-05 16:12:25 +02:00
Kovid Goyal
80be4071c9 Disable continuous polling of CPU count in load segment 2013-04-05 16:12:25 +02:00
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
2d9110b5f1 Update tests 2013-04-03 14:23:20 +02:00
Kim Silkebækken
cde7669251 Add parameters to shorten uptime display
Ref #316
2013-04-03 14:22:37 +02: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