PEP8 fixes.
authorSimon Cross <hodgestar@gmail.com>
Sun, 11 May 2014 20:33:46 +0000 (22:33 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sun, 11 May 2014 20:35:00 +0000 (22:35 +0200)
naja/widgets/text.py

index 8b1e3c68314cec2786f7fbf5aaae8a1291289a5b..9ecd0db47322287e214a0682b063a4b18ee2c9cf 100644 (file)
@@ -27,6 +27,7 @@ class TextWidget(Widget):
     def draw(self, surface):
         surface.blit(self.surface, self.rect)
 
+
 class TextBoxWidget(TextWidget):
     def __init__(self, *args, **kwargs):
         self.padding = kwargs.pop('padding', 5)
@@ -37,7 +38,7 @@ class TextBoxWidget(TextWidget):
                                                        (0, 0, 0)))
         self.box_width = kwargs.pop('box_width', 0)
 
-        super(TextBoxWidget,self).__init__(*args, **kwargs)
+        super(TextBoxWidget, self).__init__(*args, **kwargs)
 
     def prepare(self):
         self.font = resources.get_font(self.fontname, self.fontsize)
@@ -50,7 +51,7 @@ class TextBoxWidget(TextWidget):
                 current_line_rendered = None
                 for word in line.split(' '):
                     if len(current_line) > 0:
-                        current_line += ' '+ word
+                        current_line += ' ' + word
                     else:
                         current_line = word
                     line = self.font.render(current_line, True, self.colour)
@@ -61,24 +62,26 @@ class TextBoxWidget(TextWidget):
                     elif current_line_rendered is not None:
                         line_rect = current_line_rendered.get_rect()
                         self.lines.append(pygame.transform.scale(
-                            current_line_rendered,(line_rect.width * 2,
-                                                   line_rect.height * 2)))
+                            current_line_rendered, (line_rect.width * 2,
+                                                    line_rect.height * 2)))
                         current_line = word
-                        current_line_rendered = self.font.render(word, True, self.colour)
+                        current_line_rendered = self.font.render(
+                            word, True, self.colour)
                     else:
-                        raise Exception('Line too long. Please resize or rephrase')
+                        raise Exception(
+                            'Line too long. Please resize or rephrase')
                 if current_line_rendered is not None:
                     line_rect = current_line_rendered.get_rect()
                     self.lines.append(pygame.transform.scale(
-                        current_line_rendered,(line_rect.width * 2,
-                                               line_rect.height * 2)))
+                        current_line_rendered, (line_rect.width * 2,
+                                                line_rect.height * 2)))
             else:
                 line = self.font.render(line, True, self.colour)
                 line_rect = line.get_rect()
                 width = max(width, line.get_rect().width)
                 height += line.get_rect().height
-                self.lines.append(pygame.transform.scale(line, (line_rect.width * 2,
-                                                             line_rect.height * 2)))
+                self.lines.append(pygame.transform.scale(
+                    line, (line_rect.width * 2, line_rect.height * 2)))
 
         width += 2 + self.padding
         height += 2 + self.padding
@@ -94,4 +97,3 @@ class TextBoxWidget(TextWidget):
         self.text_rect = surface.get_rect()
         if not self.size:
             self.rect.size = self.text_rect.size
-