Commit Graph

622 Commits

Author SHA1 Message Date
ZyX de678ed289 Create VimPowerline.reset_highlight proxy method
Fixes #411
2013-04-09 00:37:53 +04:00
Kim Silkebækken a7daa507ab Merge remote-tracking branch 'zyx-i/alter-priority' into develop 2013-04-08 11:47:51 +02:00
Kim Silkebækken 0c7cc25a02 Merge remote-tracking branch 'zyx-i/threaded-cpu_load_percent' into develop 2013-04-08 11:39:23 +02:00
Kim Silkebækken 51a9bbdbce Merge remote-tracking branch 'zyx-i/ipython-shutdown' into develop 2013-04-08 11:38:04 +02:00
Kim Silkebækken e6ae8ca49f Merge remote-tracking branch 'zyx-i/persistent-awesome' into develop 2013-04-08 11:36:44 +02:00
ZyX 24dde27b7e Alter the priority of branch and line_percent segments
Unlike file_type and file_directory branch cannot be deduced from the filename 
(you normally know directory structure of the project) and contents of the file.

Unlike file_format and file_encoding which are normally configured once and then 
forgotten about knowing branch segment is necessary to separate commits.
2013-04-08 08:59:56 +04:00
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 b2cb5b1e94 Fix gradient level in email_imap_alert segment
Closes #407
2013-04-08 07:49:44 +04:00
ZyX 340bdc7a51 Add other self.pl proxies 2013-04-07 19:15:58 +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
ZyX 8dcbb031aa Make IPython renderer shutdown properly 2013-04-07 13:19:20 +04:00
ZyX 66cdb36231 Use xml.sax.saxutils.escape in place of xmlrpclib.escape
The latter is not available in python 3
2013-04-07 04:42:36 +04:00
ZyX 6f57a3dd63 Some fixes for flake8 2013-04-07 04:30:51 +04:00
ZyX b507029741 Replace shell script with python one 2013-04-07 04:23:31 +04:00
ZyX 3c613bc1b7 Use xmlrpclib.escape for escaping in PangoMarkupRenderer 2013-04-07 04:20:35 +04:00
ZyX 9ce63d1657 Allow non-format messages 2013-04-07 03:24:39 +04:00
ZyX 8cb1538e8e Normalize modelines 2013-04-07 02:32:29 +04:00
ZyX 6212711231 Add forgotten self.updated set
Ref #367
2013-04-06 21:23:25 +04:00
ZyX b1fecebd53 Some fixes for flake8 2013-04-06 18:56:19 +04:00
ZyX e68bae6409 Add fixes for flake8 to that stuff 2013-04-06 18:53:16 +04:00
ZyX 42ee82c1de Update *watcher stuff from @kovidgoyal develop branch 2013-04-06 18:48:04 +04:00
ZyX b17dab0cd4 Handle removed files 2013-04-06 18:30:33 +04:00
ZyX d1d05c9dcf Add support for reloading configuration in the main thread 2013-04-06 18:09:45 +04:00
ZyX 296107d68e Improve lint number (interval and priority) checks 2013-04-06 18:07:30 +04:00
ZyX 88865b1145 Defer create_renderer (and thus thread creation) until .render call
May fix problem discussed in #397

Also fix documentation for Powerline.render().
2013-04-06 17:18:59 +04:00
ZyX af2f8f588b Replace MultiClientWatcher and Powerline threads with ConfigLoader
Also
- move file opening and parsing to ConfigLoader
- add interval configuration
2013-04-06 17:18:25 +04:00
ZyX f0e5f43d48 Make it use existing shutdown events
Also adds check to powerline-lint that "args" dictionary does not set
shutdown_event, segment_info or pl keyword arguments, this will lead to problems
2013-04-06 17:17:49 +04:00
ZyX f45084057a Remove debugging function 2013-04-06 17:17:49 +04:00
ZyX b188662844 Move some thread functions to a separate class 2013-04-06 17:17:41 +04:00
ZyX 47eef9860f Use different emulate call
Ref #389
2013-04-06 17:16:54 +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
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 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 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
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
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 46b5063ea8 Remove unused import 2013-03-31 15:01:06 +04:00
ZyX e35b1541e8 Make it possible to supply different watcher
Used in tests
2013-03-31 13:36:41 +04: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 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
ZyX e5db01193c Add missing PowerlineState.use_daemon_threads assignment 2013-03-26 08:20:32 +04:00
ZyX 878b808e9e Workaround deadlock in ipython
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.
2013-03-26 08:12:35 +04:00
ZyX 27c9a05782 Change indentation of closing }, ], ) and combinations of them 2013-03-25 19:04:18 +04:00
ZyX 3f53aa298a Use global watcher 2013-03-25 18:43:29 +04:00
ZyX fc6636cf57 Clear Powerline.configs when loading main configuration
It should eventually clear out stale watches.
2013-03-25 18:41:38 +04:00
ZyX 7646c949e2 Automatically reload configuration
Needs testing
2013-03-25 18:24:17 +04:00
ZyX 5d1089f252 Some fixes for flake8, remove executable bit and shebang 2013-03-25 18:24:17 +04:00
ZyX 559b5caef2 Take file_watcher from @kovidgoyal develop branch 2013-03-25 18:24:17 +04:00
ZyX 80ddbfbf9a Split Powerline.__init__ into __init__ and create_renderer
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.
2013-03-25 18:24:16 +04:00
ZyX 92652ca5c4 Some fixes for flake8 2013-03-25 00:10:54 +04:00
ZyX 8c63d20880 Fix update_first 2013-03-24 22:39:31 +04:00
ZyX 3aab9ef96c Make zsh/zpython also call .shutdown correctly 2013-03-24 22:24:48 +04:00
ZyX 3809b8b3b5 Allow multiple shutdowns with multiple starts 2013-03-24 22:24:48 +04:00
ZyX 80e55b0c81 Replace update_lock with shutdon_event 2013-03-24 22:24:48 +04:00
ZyX b6143cf429 Readd log_ prefix and expand log_file 2013-03-24 21:04:09 +04:00
ZyX 7764bcc6a1 Fix logging format
Fixes #361
2013-03-24 20:21:21 +04:00
ZyX 1351207462 Some fixes for flake8 2013-03-24 19:59:56 +04:00
ZyX 14d957bdf9 Skip crashed segments 2013-03-24 19:49:54 +04:00
ZyX ca2f0cc873 Do not wait for update lock, exit 2013-03-24 19:49:54 +04:00
ZyX 63a50ad200 Remove run_once from ShellPowerline, fix update_first
run_once will be passed to Powerline as a part of **kwargs
2013-03-24 19:49:54 +04:00
ZyX 8a51d99389 Some fixes for zsh, remove some exceptions handling
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
2013-03-24 19:48:51 +04:00
ZyX ed435f8063 Add required pl argument to segments
Fixes #340
Ref #330
2013-03-24 19:44:01 +04:00
ZyX cc1c982696 Move configuration to /etc/xdg/powerline
XDG_CONFIG_DIRS is set in /etc/env.d by configuration from xdg-utils package, 
but it is not guaranteed to be present in the system
2013-03-24 19:35:25 +04:00
ZyX e151b600b2 Use python’s try/catch, not vim’s
Fixes #344
2013-03-24 19:35:25 +04:00
ZyX 127a600e1b Rework API for custom vim events 2013-03-24 19:35:25 +04:00
ZyX a021916428 Make update_first configurable 2013-03-24 19:35:25 +04:00
ZyX e6dd40bff0 Fix behavior with run_once: .update() was called too much times 2013-03-24 19:35:25 +04:00
ZyX a65a27e673 Allow multiple starts by not subclassing from Thread 2013-03-24 19:35:25 +04:00
ZyX 0c9337bd72 Allow multiple shutdown calls 2013-03-24 19:35:25 +04:00
ZyX 840ac0109b Port common.branch segment to KwThreaded*, add common.repository_status 2013-03-24 19:35:25 +04:00
Kim Silkebækken 5caeac26bf Merge remote-tracking branch 'zyx-i/fix-356' into develop 2013-03-24 16:18:44 +01:00
Kim Silkebækken 154fe123fe Merge remote-tracking branch 'zyx-i/ipython-other' into develop 2013-03-24 16:18:26 +01:00
Kim Silkebækken 7a096f6c9d Merge remote-tracking branch 'zyx-i/colors' into develop 2013-03-24 16:18:07 +01:00
ZyX 33592145ae Also fix VimRenderer.strwidth
Fixes #356
2013-03-24 05:56:55 +04:00
ZyX 87e39d0b56 Autodetect python version 2013-03-24 05:51:41 +04:00
ZyX b517df774b Fix bytes handling on python3
Fixes #356
2013-03-24 05:45:52 +04:00
ZyX c4e5ff8b49 Added support for all powerline prompts (in2, out, rewrite)
Also fixed problem with prompt not really updating.

Fixes #141
2013-03-24 05:23:33 +04:00
ZyX bb06207838 Some lint fixes
* Fixed handling of empty scalars in python2: ''.join([]) returns str,
  ''.join([u'smth']) returns unicode
* Fixed check_config: it was always checking for themes, even if it was
  requested to check colorscheme
2013-03-24 05:23:33 +04:00
ZyX 83ed36903c Fix bold attr that may leak into next segment 2013-03-24 05:23:33 +04:00
ZyX b1f9edab4c Remove get_segment_info and passing segment_info through globals 2013-03-24 05:23:33 +04:00
ZyX 004e6a8b46 Add gradient to email_imap_alert segment
Colors probably need to be revised

Fixes #301
2013-03-24 01:43:37 +04:00
ZyX 25806fa075 Added gradient for network_load segment 2013-03-24 01:33:56 +04:00
ZyX 37b684dcd3 Fix checks for gradient groups (it was not forcing gradient colors) 2013-03-24 01:19:58 +04:00
ZyX 157b849d33 Make weather gradient configurable, add system_load gradient
Also make gradients floating-point and fix #332 by removing “normalized” from 
system_load segment documentation.
2013-03-24 00:55:54 +04:00
Kovid Goyal b951907912 Autodetect network interfaces to monitor 2013-03-21 17:24:09 +01:00
ZyX 0610316e25 Make prompt* sets non-local
Fixes #342
2013-03-21 07:52:54 +04:00
ZyX 11aa74c634 Make it use gradient for weather temperature
Ref #301
2013-03-19 23:25:44 +04:00
ZyX 3e4a98b174 Make green_yellow_orange_red grad use <16 colors, added 2 more grads
They are currently unused
2013-03-19 23:25:44 +04:00
ZyX 1a4eeadbee Added green_yellow_orange_red gradient for line % in solarized
Ref #301
2013-03-19 23:25:44 +04:00
ZyX 1dc039a3b0 Some small changes in .segments.vim 2013-03-19 00:29:41 +04:00
Kovid Goyal fd6c1f1e13 Avoid divisin by zero exception in the network load segment 2013-03-19 00:26:57 +04:00
ZyX 4551bd2887 threaded: Add .update_first, leave .queries as-is unless key’s missing
Fixes #335
Closes #336
2013-03-19 00:26:57 +04:00
ZyX ca723aafaa Skip external_ip segment if self.ip is not defined
Ref #335
2013-03-18 23:58:06 +04:00
ZyX 137ae5f990 Change hook type
It makes sense to run _powerline_tmux_set_pwd only when working directory is 
changed.
2013-03-18 23:55:14 +04:00
Kovid Goyal c92aaef0e5 bzr segment: Handle repos with shelves correctly
Return None instead of a string with spaces for a clean repo with
shelves.
2013-03-18 08:27:43 +01:00
ZyX bb63722fb1 Also call .shutdown() in ipython 2013-03-18 08:15:02 +04:00
ZyX b0495d028f Do not let daemon threads be stopped while being updated 2013-03-18 07:56:25 +04:00
ZyX 60cc0196e8 Remove @ from documentation which was present for unknown reason 2013-03-17 22:07:37 +04:00
ZyX 34fba2286a Fix documentation for wrapped functions 2013-03-17 22:07:27 +04:00
ZyX 19b45e609a Fix documentation for threaded segments 2013-03-17 22:06:52 +04:00
ZyX ce65470ac3 Fix shorten_cwd handling 2013-03-17 21:23:27 +04:00
ZyX ceabd372d4 Add temperature_format keyword argument to weather segment 2013-03-17 21:23:26 +04:00
ZyX a1b0b6239f Add format keyword argument to network_load segment 2013-03-17 21:23:26 +04:00
ZyX f9e9b2cd22 Change uptime format, make it accept seconds if needed
It is uncommon to use integers like 00 or 01 for days.
2013-03-17 21:23:26 +04:00
ZyX 050a34bceb Avoid ResourceWarning messages: close stdout 2013-03-17 21:23:26 +04:00
ZyX f547e8b85f Some fixes for flake8 2013-03-17 21:23:15 +04:00
ZyX 62e731314e Replace memoize with threading where applicable
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
2013-03-17 21:22:33 +04:00
ZyX a4adc92215 Do not import memoize, humanize_bytes and urllib_* in powerline.lib 2013-03-17 21:21:03 +04:00
ZyX 29eccf409b Use psutil module for `user` segment 2013-03-17 13:28:57 +04:00
ZyX 93e41bf2c4 Make psutil.BOOT_TIME fallback for /proc/uptime
Method used with psutil.BOOT_TIME is subject to changes when clock_settime
changes time, /proc/uptime is not.
2013-03-17 13:17:55 +04:00
ZyX f8db46b406 Use proper clock if possible 2013-03-15 19:31:08 +04:00
ZyX abe0b1a647 Add support for .startup and .shutdown methods 2013-03-15 19:31:08 +04:00
ZyX c237e66958 Make file_size segment output buffer size 2013-03-15 19:31:08 +04:00
ZyX 6f679e08aa Refactor powerline.lib.url 2013-03-15 19:31:08 +04:00
Ali B f141574d89 Make vim Visual Block mode orange in Solarized colourscheme.
This makes it consistent with the styles of the other visual modes.
Reference issue #147.
2013-03-15 14:19:35 +01:00
Kim Silkebækken 8cdd12a800 Merge remote-tracking branch 'zyx-i/326-fix-None-handling' into develop 2013-03-15 14:18:03 +01:00
Kovid Goyal dda500a673 Only use locally stored bzr branch nickname
Fixes #324 (slow vcs branch segment with bzr checkout)
2013-03-15 14:17:25 +01:00
Kim Silkebækken 747c75c1c4 Merge remote-tracking branch 'zyx-i/fix-322' into develop 2013-03-15 14:15:26 +01:00
Kim Silkebækken 24097293e5 Catch all urllib errors in urrlib_read() 2013-03-15 08:32:25 +01:00
ZyX 48470221f0 Make git.Repository.status() also return None
Fixes #326
2013-03-14 20:03:26 +04:00
ZyX e24703dbdd Add status_colors argument to branch segments
Closes #206
2013-03-13 16:51:53 +04:00
ZyX d8c64c5e3a Fix keyword argument name 2013-03-13 07:33:47 +04:00
ZyX 271cfe06b1 Add parameter to disable current and user directories shortening
Fixes #322
2013-03-13 01:01:07 +04:00
ZyX 1960e8329f Remove useless import 2013-03-12 13:12:14 +01:00
ZyX 6f3703e312 Improve ambiwidth handling, readd additional_escapes
Fixes #307
2013-03-12 13:11:59 +01:00
ZyX 417e823e96 Fix two flake8 errors 2013-03-11 22:24:00 +04:00
ZyX b2b05cb81c Removed underscore_to_camelcase
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.
2013-03-11 22:22:18 +04:00
ZyX 696478593d Move some functions out of classes
No need to have static methods that are not supposed to be overridden and that 
do not benefit from `self' argument they do not receive
2013-03-11 22:13:43 +04:00
ZyX fe6f1bf4d5 Handle AttributeError also when importing segment function 2013-03-11 19:19:55 +04:00
ZyX 1ef1ad7cfe Add missing import 2013-03-11 19:19:42 +04:00
ZyX 24d662c823 Make lint more error-prone
Target: report as much errors as possible in a single run without failure
2013-03-11 19:19:28 +04:00
ZyX 9dc69d91ad Make Reader also produce MarkedError, remove JSONError 2013-03-11 19:19:09 +04:00
ZyX 49ad855eb5 Rename YAMLError to JSONError and MarkedYAMLError to MarkedError 2013-03-11 19:18:53 +04:00
ZyX 5da848fa4a Some fixes for flake8 2013-03-11 19:18:53 +04:00
ZyX 3fd1215091 Some changes to make it work in non-python2.7 2013-03-11 19:18:53 +04:00
ZyX f75bb9e65b Make parser less restrictive and able to report problems 2013-03-11 19:18:53 +04:00
ZyX d27f7a0411 Add most configuration checks
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
2013-03-11 19:17:18 +04:00
ZyX 287a88f473 Add JSON parser producing marked values
Ref #278
2013-03-11 19:14:35 +04:00
ZyX 5b11feac73 Make some functions be more convenient for use in lint checker 2013-03-11 19:12:32 +04:00
ZyX d33b8ee946 Fix highlight group documentation for line_percent 2013-03-11 19:12:15 +04:00
ZyX 9e8fab3312 Add highlight group data for powerline-lint 2013-03-11 19:12:03 +04:00
ZyX 7fca338315 Remove unused “colors” key 2013-03-11 19:11:51 +04:00
ZyX 551a2685f4 Move add_local_theme and get_theme to vim renderer
In any case for all other extensions they are useless. (Except for ipython, but
it is TODO and I am not going to use matchers this way, simple dictionary
lookup is better in this case.)
2013-03-11 19:11:32 +04:00
ZyX 657fcd1a99 Make @window_cached use @wraps
Otherwise documentation is not saved (hidden in decorated function only visible
in the closure).
2013-03-11 19:11:17 +04:00
ZyX ae62aee529 Renamed term_24bit_colors to term_truecolor 2013-03-11 19:11:10 +04:00
Kim Silkebækken 111eaa27e8 Combine vim modelines and Python encoding declarations
Ref #314
2013-03-11 10:40:09 +01:00
Peter Fern b31c987cc8 Add XDG_CONFIG_DIRS to config_paths for system-wide install
Commonly this will be `/etc/xdg/powerline`
2013-03-11 08:25:35 +01:00
Kim Silkebækken 6748701fcb Add vim modelines to all Python files
Added with `sed -i '2i# vim:fenc=utf-8:noet' `find -name '*.py'`` and
fixed in a couple of files without the UTF-8 encoding on top.

Ref #314
2013-03-11 08:11:25 +01:00
Kim Silkebækken 40fe38f641 Move argparser to powerline.shell so it can be re-used 2013-03-11 07:52:24 +01:00
ZyX 59ef974b29 Fix set statusline location, readd fix from #243
Ref #303
2013-03-11 07:16:30 +01:00
Kovid Goyal c70d3b38b6 Add bzr support 2013-03-11 07:09:42 +01:00
Kim Silkebækken 6777fd41d4 Fix minor typo in powerline.vim 2013-03-08 18:03:57 +01:00
Kim Silkebækken be62815c0b Handle socket errors in IMAP mail segment 2013-03-04 15:13:58 +01:00
ZyX f6d23bdf7e Always return a string in email_imap_alert segment
Fixes #279
2013-03-03 21:05:06 +01:00
ZyX c429d9eeb2 Omit using sys.modules if possible
Does not work though: still TypeError due to some global in multiproccessing
that got None
2013-03-03 21:03:34 +01:00
ZyX 584755765b Start adding tests
Tests are temporary disabled on all branches except tests (does not really work
though, needs travis.yml in all branches).
2013-03-03 21:03:19 +01:00
ZyX 2a39ed83d8 Use mode(1)
Otherwise all that fancy double-symbol modes are just not visible.
2013-03-03 21:03:19 +01:00
ZyX 47cfde0ecc Add support for python-2.6 2013-03-03 21:03:17 +01:00
ZyX 9fd63021f0 Add support for python-3.2 2013-03-03 21:03:08 +01:00
ZyX de33eb8140 Add _external_ip for use in weather segment 2013-03-03 21:03:08 +01:00
ZyX 307dfd7212 Improve documentation 2013-03-03 21:03:05 +01:00
ZyX 2f17510db8 Also use hl_iter in exception message
Ref #270
2013-02-28 14:06:05 +01:00
ZyX f495c49aa1 Remove obsolete highlight_group keys from configuration
They are no no-op for function segments, so don’t confuse users
2013-02-27 01:18:16 +04:00
ZyX 16a5b7897a Use exit_fail hl group for last_status segment
Fixes #270
2013-02-27 01:06:11 +04:00
ZyX-I f3462768de Fix minimal python versions
s/3\.2/3.3
2013-02-26 21:27:59 +01:00
ZyX c2cf679c6f Do not throw away python stack trace
Errors when loading powerline fails are almost never giving any useful
information for debugging.
2013-02-26 21:26:33 +01:00
ZyX 83f4236a2c Replace unicode() with u() in theme.py
Fixes #271
2013-02-27 00:14:24 +04:00