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): def __repr__(self):
return "Label {0}, child of {1}".format(self.text, self.parent) return "Label {0}, child of {1}".format(self.text, self.parent)
def get_text(self): def get_text(self):
return self._text return self._text
@ -152,6 +153,7 @@ class Label(Widget):
self.draw_with(surface, fg, bg) self.draw_with(surface, fg, bg)
is_default = False is_default = False
def draw_with(self, surface, fg, bg=None): def draw_with(self, surface, fg, bg=None):
if bg: if bg:
r = surface.get_rect() r = surface.get_rect()
@ -313,6 +315,7 @@ class SmallValueDisplay(ValueDisplay): pass
class ValueButton(ButtonBase, ValueDisplay): class ValueButton(ButtonBase, ValueDisplay):
align = 'c' align = 'c'
def get_text(self): def get_text(self):
return self.format_value(self.value) 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): def input_text(prompt, width, initial = None, **kwds):
box = Dialog(**kwds) box = Dialog(**kwds)
d = box.margin d = box.margin
def ok(): def ok():
box.dismiss(True) box.dismiss(True)
def cancel(): def cancel():
box.dismiss(False) box.dismiss(False)
lb = Label(prompt) lb = Label(prompt)
lb.topleft = (d, d) lb.topleft = (d, d)
tf = TextField(width) tf = TextField(width)

View File

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

View File

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