Fix various minor formatting issues

Closes #242.
This commit is contained in:
Kim Silkebækken 2013-02-20 13:47:54 +01:00
parent ee51b8b76c
commit 282cb43eef
9 changed files with 65 additions and 61 deletions

View File

@ -15,7 +15,7 @@ class PowerlinePrompt(BasePrompt):
def auto_rewrite(self):
# TODO color this
return '%s>%s' % ('-'*self.prompt_text_len, ' '*self.nrspaces)
return '%s>%s' % ('-' * self.prompt_text_len, ' ' * self.nrspaces)
def setup(prompt='1'):

View File

@ -5,8 +5,8 @@ ATTR_BOLD = 1
ATTR_ITALIC = 2
ATTR_UNDERLINE = 4
class Colorscheme(object):
class Colorscheme(object):
def __init__(self, colorscheme):
'''Initialize a colorscheme.'''
self.colors = {}

View File

@ -3,6 +3,10 @@ import os
from powerline.lib.memoize import memoize
vcs_props = (('git', '.git', os.path.exists),
('mercurial', '.hg', os.path.isdir))
def generate_directories(path):
yield path
while True:
@ -13,9 +17,6 @@ def generate_directories(path):
yield path
vcs_props = (('git', '.git', os.path.exists),
('mercurial', '.hg', os.path.isdir))
@memoize(100)
def guess(path):
for directory in generate_directories(path):

View File

@ -42,7 +42,7 @@ class Renderer(object):
theme.segment_info.update(segment_info)
# Handle excluded/included segments for the current mode
segments = [segment for segment in segments\
segments = [segment for segment in segments
if mode not in segment['exclude_modes'] or (segment['include_modes'] and segment in segment['include_modes'])]
segments = [segment for segment in self._render_segments(mode, theme, segments)]

View File

@ -6,7 +6,7 @@ import os
try:
import vim
except ImportError:
vim = {}
vim = {} # NOQA
from powerline.bindings.vim import vim_get_func, getbufvar
from powerline.theme import requires_segment_info
@ -49,15 +49,16 @@ mode_translations = {
}
eventcaches = defaultdict(lambda : [])
bufeventcaches = defaultdict(lambda : [])
eventcaches = defaultdict(lambda: [])
bufeventcaches = defaultdict(lambda: [])
def purgeonevents_reg(events, eventcaches=bufeventcaches):
def cache_reg_func(cache):
for event in events:
if event not in eventcaches:
vim.eval('PowerlineRegisterCachePurgerEvent("' + event + '")')
eventcaches[event].append(cache)
return cache_reg_func
purgeall_on_shell = purgeonevents_reg(('ShellCmdPost', 'ShellFilterPost', 'FocusGained'), eventcaches=eventcaches)

View File

@ -5,8 +5,9 @@ from copy import copy
from .segment import Segment
try:
unicode()
unicode() # NOQA
except NameError:
unicode = str

View File

@ -11,7 +11,8 @@ try:
except IOError:
README = ''
setup(name='Powerline',
setup(
name='Powerline',
version='beta',
description='The ultimate statusline/prompt utility.',
long_description=README,