Commit Graph

21 Commits

Author SHA1 Message Date
ZyX 484b9af6ed Use the same function for getting encoding in Python client and daemon 2014-08-27 22:38:52 +04:00
ZyX 7871cfcda4 Use posix.environ in Python client if available
This way there will be no need in converting keys and values to bytes objects on
\*nix systems.
2014-08-27 22:38:52 +04:00
ZyX 5434852977 A few style improvements in Python client 2014-08-27 22:38:52 +04:00
ZyX 70e7088b04 Do not replace ascii with UTF-8 in powerline-daemon and python client
Assuming ascii was expected to be used when LANG=C it did not work in any case:
in this case preferred encoding is “ANSI_X3.4-1968”. Same for
`sys.getfilesystemencoding()`.
2014-08-27 22:34:13 +04:00
Pierre Carru c4aa72fc1f Make shell client work in OS X:
- use gnu env for `env -0`,
- use filesystem socket.
2014-08-26 10:37:32 +01:00
ZyX 0232d3215b Add --socket argument to all clients
Makes it not needed to kill daemon for testing, but disables implicit
`powerline-config shell command` testing.
2014-08-23 15:19:00 +04:00
ZyX dc76396912 Solve encoding issues in powerline python client 2014-08-23 15:18:59 +04:00
ZyX 6f550fce8b Write zero after writing current working directory in powerline.c 2014-08-10 16:13:33 +04:00
ZyX 660925f0c2 Use do_write function in place of self-written replacement 2014-08-06 22:39:50 +04:00
ZyX 0a6bb9ce08 Some style fixes 2014-08-06 22:39:50 +04:00
ZyX ae2ac05ced Handle errors from write()
Fixes #964
2014-08-06 22:11:35 +04:00
ZyX 203a374b54 Do not use argparge for parsing --env and --cwd
It took 2/3 of do_render call according to profiler. New variant takes only 1/6.

WARNING: This commit will break all powerline installations with running daemon
because it changes communication protocol. You must kill and restart all your
powerline daemons for powerline to function properly.

Highlight @kovidgoyal
2014-08-04 03:02:05 +04:00
ZyX da45adb9e6 Make it compile without warnings with -Wconversion 2014-08-04 03:02:05 +04:00
ZyX a5037a817b Fix powerline.c styling
Also makes it compile with -std=c89 (except for snprintf) or just -std=c99,
-Wall, -pedantic.
2014-08-04 03:02:05 +04:00
ZyX f3d972849e Fall back to powerline-render when using powerline.sh 2014-08-02 21:31:01 +04:00
ZyX 95dcef8bf8 Some style fixes 2014-08-02 21:30:51 +04:00
ZyX 3b060562e2 Fix UnicodeDecodeError in Python version of powerline client 2014-08-02 19:46:04 +04:00
ZyX e37b13cc44 Remove compiled binary from repository 2014-08-02 18:56:44 +04:00
ZyX e613beb8df Add shell version of powerline-client
Note: this shell script is still faster then client/powerline.py. `time` reports 
      0.00, 0.01, 0.02÷0.03 for powerline, powerline.sh and powerline.py 
      respectively (run with `./client/powerline* tmux right`).

Note: does not work in busybox as env there does not support -0 argument. 
      Requires sed, id (for dash as $UID is not available there), env, printf 
      and socat. Is not currently handled by setup.py.
2014-08-02 18:53:25 +04:00
ZyX 7db428667c Get rid of modeline E518 error 2014-08-02 18:53:25 +04:00
Kim Silkebækken a122e73b9b Add files from @kovidgoyal's powerline-daemon repo
Minor changes have been applied:

- Removed copyright info and GPL 3 license since Powerline is MIT (needs
  confirmation from kovidgoyal before merge)
- The `powerline-client` script is renamed to `powerline`, and calls the
  daemon or `powerline-render` (the previous `powerline`) to render
  a statusline
- Minor coding style corrections to match the rest of the project
- Python 3 support is removed for now due to setuptools failing with
  binary scripts

Todo:

- Automatically attempt to launch powerline-daemon the first time
  powerline is run if the daemon isn't already running?
- pip install -e fails with binary files (it appears that pip recodes
  the powerline binary to ASCII, the compiled powerline script must be
  copied manually to ~/.local/bin after pip install -e has been run)
2014-08-02 18:45:18 +04:00