From 4d225179d092136a03d60840ae628e4db895fa34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Wed, 5 Dec 2012 16:37:16 +0100 Subject: [PATCH] Reorganize files --- lib/renderers/__init__.py | 7 ------- {lib => powerline}/__init__.py | 0 lib/colors.py => powerline/colorscheme.py | 2 ++ {lib => powerline}/core.py | 0 {vim => powerline/ext}/__init__.py | 0 powerline/ext/terminal/__init__.py | 0 .../terminal.py => powerline/ext/terminal/renderer.py | 0 powerline/ext/tmux/__init__.py | 0 lib/renderers/tmux.py => powerline/ext/tmux/renderer.py | 0 powerline/ext/vim/__init__.py | 0 {vim => powerline/ext/vim}/bindings.py | 0 lib/renderers/vim.py => powerline/ext/vim/renderer.py | 0 {vim => powerline/ext/vim}/segments/__init__.py | 0 {vim => powerline/ext/vim}/segments/core.py | 4 ++-- powerline/renderer.py | 1 + powerline/segment.py | 1 + powerline/theme.py | 1 + 17 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 lib/renderers/__init__.py rename {lib => powerline}/__init__.py (100%) rename lib/colors.py => powerline/colorscheme.py (99%) rename {lib => powerline}/core.py (100%) rename {vim => powerline/ext}/__init__.py (100%) create mode 100644 powerline/ext/terminal/__init__.py rename lib/renderers/terminal.py => powerline/ext/terminal/renderer.py (100%) create mode 100644 powerline/ext/tmux/__init__.py rename lib/renderers/tmux.py => powerline/ext/tmux/renderer.py (100%) create mode 100644 powerline/ext/vim/__init__.py rename {vim => powerline/ext/vim}/bindings.py (100%) rename lib/renderers/vim.py => powerline/ext/vim/renderer.py (100%) rename {vim => powerline/ext/vim}/segments/__init__.py (100%) rename {vim => powerline/ext/vim}/segments/core.py (97%) create mode 100644 powerline/renderer.py create mode 100644 powerline/segment.py create mode 100644 powerline/theme.py diff --git a/lib/renderers/__init__.py b/lib/renderers/__init__.py deleted file mode 100644 index 3c7c2387..00000000 --- a/lib/renderers/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -class SegmentRenderer: - def hl(self, fg=None, bg=None, attr=None): - raise NotImplementedError - -from lib.renderers.terminal import TerminalSegmentRenderer -from lib.renderers.tmux import TmuxSegmentRenderer -from lib.renderers.vim import VimSegmentRenderer diff --git a/lib/__init__.py b/powerline/__init__.py similarity index 100% rename from lib/__init__.py rename to powerline/__init__.py diff --git a/lib/colors.py b/powerline/colorscheme.py similarity index 99% rename from lib/colors.py rename to powerline/colorscheme.py index c0a34e45..cb345904 100644 --- a/lib/colors.py +++ b/powerline/colorscheme.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + cterm_to_hex = { 16: 0x000000, 17: 0x00005f, 18: 0x000087, 19: 0x0000af, 20: 0x0000d7, 21: 0x0000ff, 22: 0x005f00, 23: 0x005f5f, 24: 0x005f87, 25: 0x005faf, 26: 0x005fd7, 27: 0x005fff, diff --git a/lib/core.py b/powerline/core.py similarity index 100% rename from lib/core.py rename to powerline/core.py diff --git a/vim/__init__.py b/powerline/ext/__init__.py similarity index 100% rename from vim/__init__.py rename to powerline/ext/__init__.py diff --git a/powerline/ext/terminal/__init__.py b/powerline/ext/terminal/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lib/renderers/terminal.py b/powerline/ext/terminal/renderer.py similarity index 100% rename from lib/renderers/terminal.py rename to powerline/ext/terminal/renderer.py diff --git a/powerline/ext/tmux/__init__.py b/powerline/ext/tmux/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lib/renderers/tmux.py b/powerline/ext/tmux/renderer.py similarity index 100% rename from lib/renderers/tmux.py rename to powerline/ext/tmux/renderer.py diff --git a/powerline/ext/vim/__init__.py b/powerline/ext/vim/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/vim/bindings.py b/powerline/ext/vim/bindings.py similarity index 100% rename from vim/bindings.py rename to powerline/ext/vim/bindings.py diff --git a/lib/renderers/vim.py b/powerline/ext/vim/renderer.py similarity index 100% rename from lib/renderers/vim.py rename to powerline/ext/vim/renderer.py diff --git a/vim/segments/__init__.py b/powerline/ext/vim/segments/__init__.py similarity index 100% rename from vim/segments/__init__.py rename to powerline/ext/vim/segments/__init__.py diff --git a/vim/segments/core.py b/powerline/ext/vim/segments/core.py similarity index 97% rename from vim/segments/core.py rename to powerline/ext/vim/segments/core.py index e5586d96..a08d1443 100644 --- a/vim/segments/core.py +++ b/powerline/ext/vim/segments/core.py @@ -74,7 +74,7 @@ def readonly_indicator(text=u'⭤'): return text if int(vim.eval('&readonly')) else None -def branch(symbol=u'⭠'): +def branch(): '''Return VCS branch. TODO: Expand this function to handle several VCS plugins. @@ -87,7 +87,7 @@ def branch(symbol=u'⭠'): except TypeError: pass - return symbol + ' ' + branch if branch else None + return branch if branch else None def file_directory(): diff --git a/powerline/renderer.py b/powerline/renderer.py new file mode 100644 index 00000000..40a96afc --- /dev/null +++ b/powerline/renderer.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/powerline/segment.py b/powerline/segment.py new file mode 100644 index 00000000..40a96afc --- /dev/null +++ b/powerline/segment.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/powerline/theme.py b/powerline/theme.py new file mode 100644 index 00000000..40a96afc --- /dev/null +++ b/powerline/theme.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*-