pep8 compliance: E301 expected 1 blank line

This commit is contained in:
David Sowder 2012-02-21 18:12:13 -06:00
parent 623dcf524d
commit 83e9d0bd68
4 changed files with 12 additions and 0 deletions

View File

@ -120,6 +120,7 @@ class Label(Widget):
def __repr__(self):
return "Label {0}, child of {1}".format(self.text, self.parent)
def get_text(self):
return self._text
@ -152,6 +153,7 @@ class Label(Widget):
self.draw_with(surface, fg, bg)
is_default = False
def draw_with(self, surface, fg, bg=None):
if bg:
r = surface.get_rect()
@ -313,6 +315,7 @@ class SmallValueDisplay(ValueDisplay): pass
class ValueButton(ButtonBase, ValueDisplay):
align = 'c'
def get_text(self):
return self.format_value(self.value)

View File

@ -123,10 +123,13 @@ def ask(mess, responses = ["OK", "Cancel"], default = 0, cancel = -1,
def input_text(prompt, width, initial = None, **kwds):
box = Dialog(**kwds)
d = box.margin
def ok():
box.dismiss(True)
def cancel():
box.dismiss(False)
lb = Label(prompt)
lb.topleft = (d, d)
tf = TextField(width)

View File

@ -154,8 +154,10 @@ class TextEditor(Widget):
def pos_to_index(self, x):
text = self.get_text()
font = self.font
def width(i):
return font.size(text[:i])[0]
i1 = 0
i2 = len(text)
x1 = 0
@ -298,6 +300,7 @@ class TextField(Field):
class IntField(Field):
tooltipText = "Point here and use mousewheel to adjust"
def type(self, i):
try:
return eval(i)
@ -309,6 +312,7 @@ class IntField(Field):
_shift_increment = 16
_increment = 1
@property
def increment(self):
if key.get_mods() & KMOD_SHIFT:

View File

@ -51,9 +51,11 @@ class FileListView(PaletteView):
client = self.client
dir = client.directory
suffixes = client.suffixes
def filter(name):
path = os.path.join(dir, name)
return os.path.isdir(path) or self.client.filter(path)
try:
names = [name for name in os.listdir(dir) if filter(name)]
#if not name.startswith(".") and filter(name)]