Commit Graph

14 Commits

Author SHA1 Message Date
ZyX 06211cbe63 Unify imports
Now imports follow the following structure:

1. __future__ line: exactly one line allowed:

        from __future__ import (unicode_literals, division, absolute_import, print_function)

   (powerline.shell is the only exception due to problems with argparse).
2. Standard python library imports in a form `import X`.
3. Standard python library imports in a form `from X import Y`.
4. and 5. 2. and 3. for third-party (non-python and non-powerline imports).
6. 3. for powerline non-test imports.
7. and 8. 2. and 3. for powerline testing module imports.

Each list entry is separated by exactly one newline from another import. If
there is module docstring it goes between `# vim:` comment and `__future__`
import. So the structure containing all items is the following:

    #!/usr/bin/env python
    # vim:fileencoding=utf-8:noet

    '''Powerline super module'''

    import sys

    from argparse import ArgumentParser

    import psutil

    from colormath.color_diff import delta_e_cie2000

    from powerline.lib.unicode import u

    import tests.vim as vim_module

    from tests import TestCase

.
2014-09-01 00:25:24 +04:00
ZyX ae92d83eae Fix powerline style
Specifically I searched for all lines that are more then one tab off compared to 
the previous line with

    BufGrep /\(^\t\+\)\S.*\n\1\t\t\+/

and replaced them with something more appropriate. Most of time this resulted in 
a few more newlines, but there are cases when I used mixed tabs/spaces 
indentation+alignment.
2014-08-15 20:58:19 +04:00
ZyX a68e01ac24 Reverse JSON output and add trailing comma
Makes it easier to copy-paste output to colors.json.
2014-07-10 18:13:16 +04:00
ZyX ca0a8a2659 Refactor generate_gradients.py 2014-07-10 18:11:03 +04:00
ZyX d1c2980ca4 Add a way to omit computing colors for terminal 2014-07-10 18:11:03 +04:00
ZyX 2e5c66c2cc Use CIE2000 to determine color distances, compute gradients in Lab
Slow
2014-07-06 11:57:31 +04:00
ZyX c3b4654bfb Fix flake8 complaints 2014-03-13 20:41:54 +04:00
ZyX 9e518ab682 Improve generate_gradients tool
Changes:

- Port argument parsing to argparse
- Add weights support
- Add ability to specify cterm palette
- Purge out first 16 colors from color choosing by default
- Improve different scales and different preview length support
2013-04-13 19:33:41 +04:00
ZyX 1351207462 Some fixes for flake8 2013-03-24 19:59:56 +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
ZyX c92dfae5dc Made tools/*.py executable 2013-03-19 23:25:44 +04:00
ZyX 910dc3e69d Made tools/generate_gradients.py work in python3 2013-03-19 23:25:44 +04:00
ZyX da8647895a Make generate_gradients tool be able to show custom scale 2013-03-19 23:25:44 +04:00
ZyX df19981f65 Add tools/generate_gradients.py and tools/colors_find.py
First helps in generating gradients. Usage:

    python tools/generate_gradients.py '[color1, …]' itemnum[ "show"]
where color is either [100, 127, 46] (cterm colors) or ["ff00ff", "feffef"] (RGB
colors)

Second is to determine what name will be better suitable for some RGB color
2013-03-15 19:31:08 +04:00