Skip to content

Commit

Permalink
Merge pull request #166 from softdevteam/rm-trailing-whitespace
Browse files Browse the repository at this point in the history
Remove trailing whitespace.
  • Loading branch information
ltratt authored Sep 6, 2016
2 parents 5872177 + be9b148 commit 2ed80cd
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion lib/eco/cflexer/codebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ def restore_code(self, (blocks, code)):
def add_code(self, (blocks, code)):
self.code += [(depth + len(self.blocks), line) for depth, line in code]
self.blocks += blocks

2 changes: 1 addition & 1 deletion lib/eco/cflexer/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, symbol, additional_info, token):

def getsourcepos(self):
return self.token.source_pos

def __repr__(self):
return "Symbol(%r, %r)" % (self.symbol, self.additional_info)

Expand Down
14 changes: 7 additions & 7 deletions lib/eco/dotviewer/drawgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def add_edge(self, *args):
def get_display(self):
from graphdisplay import GraphDisplay
self.gdisplay = GraphDisplay(self)
return self.gdisplay
return self.gdisplay

def send(self, command, *args):
self.pgviewer.send(command, *args)
Expand All @@ -91,9 +91,9 @@ def reset(self):
# async interaction helpers

def display_async_quit():
pygame.event.post(pygame.event.Event(QUIT))
pygame.event.post(pygame.event.Event(QUIT))

def display_async_cmd(**kwds):
def display_async_cmd(**kwds):
pygame.event.post(pygame.event.Event(USEREVENT, **kwds))

EventQueue = []
Expand Down Expand Up @@ -132,7 +132,7 @@ def sethighlight(self, which):

class Edge:
label = None

def __init__(self, nodes, tail, head, cnt, *rest):
self.tail = nodes[forceunicode(tail)]
self.head = nodes[forceunicode(head)]
Expand Down Expand Up @@ -259,7 +259,7 @@ class GraphRenderer:
SCALEMIN = 3
SCALEMAX = 100
FONTCACHE = {}

def __init__(self, screen, graphlayout, scale=75):
self.graphlayout = graphlayout
self.setscale(scale)
Expand Down Expand Up @@ -312,7 +312,7 @@ def getfont(self, size):
filename = pygame.font.get_default_font()
font = self.FONTCACHE[size] = pygame.font.Font(filename, size)
return font

def setoffset(self, offsetx, offsety):
"Set the (x,y) origin of the rectangle where the graph will be rendered."
self.ofsx = offsetx - self.margin
Expand Down Expand Up @@ -646,7 +646,7 @@ def edge_at_position(self, (x, y), distmax=14):


class TextSnippet:

def __init__(self, renderer, text, fgcolor, bgcolor=None, font=None):
self.renderer = renderer
self.imgs = []
Expand Down
18 changes: 9 additions & 9 deletions lib/eco/dotviewer/graphdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def __init__(self, layout):

def initialize_keys(self):
pygame.key.set_repeat(*self.KEY_REPEAT)

mask = 0

for strnames, methodname in self.KEYS.iteritems():
Expand Down Expand Up @@ -212,7 +212,7 @@ def initialize_keys(self):
mod = mod & ~KMOD_SHIFT
self.ascii_key_cache[(char, mod)] = (method, args)
mask |= mod

self.key_mask = mask

def help(self):
Expand Down Expand Up @@ -373,7 +373,7 @@ def calculate_zoom_to_fit(self):
return min(float(self.width) / self.viewer.width,
float(self.height) / self.viewer.height,
float(self.viewer.SCALEMAX) / self.viewer.scale)

def zoom_to_fit(self):
"""
center and scale to view the whole graph
Expand All @@ -389,14 +389,14 @@ def zoom(self, scale):

def reoffset(self):
self.viewer.reoffset(self.width, self.height)

def pan(self, (x, y)):
self.viewer.shiftoffset(x * (self.width // 8), y * (self.height // 8))
self.updated_viewer()

def fast_pan(self, (x, y)):
self.pan((x * 4, y * 4))

def update_status_bar(self):
self.statusbarinfo = None
self.must_redraw = True
Expand All @@ -405,7 +405,7 @@ def update_status_bar(self):
else:
info = 'Press H for help'
self.setstatusbar(info)

def updated_viewer(self, keep_highlight=False):
self.reoffset()
if not keep_highlight:
Expand Down Expand Up @@ -629,7 +629,7 @@ def process_event(self, event):
self.method_cache[method] = method
if method is not None:
method(event)

def process_MouseMotion(self, event):
if self.peek(MOUSEMOTION):
return
Expand Down Expand Up @@ -706,7 +706,7 @@ def process_VideoResize(self, event):

def process_Quit(self, event):
self.quit()

def process_UserEvent(self, event): # new layout request
if hasattr(event, 'layout'):
if event.layout is None:
Expand All @@ -715,7 +715,7 @@ def process_UserEvent(self, event): # new layout request
self.setlayout(event.layout)
elif hasattr(event, 'say'):
self.setstatusbar(event.say)

def quit(self):
raise StopIteration

Expand Down
34 changes: 17 additions & 17 deletions lib/eco/editortab.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, parent=None):
self.scrollarea.update_theme()

self.linenumbers = LineNumbers(self)
self.linenumbers.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
self.linenumbers.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)

boxlayout.addWidget(self.linenumbers)
boxlayout.addWidget(self.scrollarea)
Expand Down Expand Up @@ -221,13 +221,13 @@ def decVSlider(self, page=False):
self.verticalScrollBar().setSliderPosition(self.verticalScrollBar().sliderPosition() - step)

class LineNumbers(QFrame):
def mouseDoubleClickEvent(self, event):
def mouseDoubleClickEvent(self, event):
if not self.parent().debugging:
return None;
return None;
# Check which number is clicked
editor = self.parent().editor
line_clicked = self.findLineNumberAt(event.y())
if line_clicked <= len(editor.lines):
if line_clicked <= len(editor.lines):
event.accept()
self.emit(SIGNAL("breakpoint"), False, line_clicked, True)

Expand All @@ -238,14 +238,14 @@ def contextMenuEvent(self, event):
editor = self.parent().editor
line_clicked = self.findLineNumberAt(event.y())

if line_clicked > len(editor.lines):
if line_clicked > len(editor.lines):
return None;
event.accept()
menu = QMenu(self)
bAction = menu.addAction("Toggle breakpoint at "+str(line_clicked))
tbAction = menu.addAction("Toggle temp breakpoint at "+str(line_clicked))
bAction = menu.addAction("Toggle breakpoint at "+str(line_clicked))
tbAction = menu.addAction("Toggle temp breakpoint at "+str(line_clicked))
bcAction = menu.addAction("Set breakpoint with condition at "+str(line_clicked))
action = menu.exec_(self.mapToGlobal(event.pos()))
action = menu.exec_(self.mapToGlobal(event.pos()))
if action == bAction:
self.emit(SIGNAL("breakpoint"), False, line_clicked, False)
elif action == tbAction:
Expand All @@ -269,7 +269,7 @@ def paintEvent(self, event):
paint.setPen(QColor("grey"))
paint.setFont(gfont.font)

debugging = self.parent().debugging
debugging = self.parent().debugging
self.breakpoint_space = 10

editor = self.parent().editor
Expand All @@ -279,18 +279,18 @@ def paintEvent(self, event):
text = str(i+1)
paint.drawText(QtCore.QPointF(self.geometry().width() - (len(text)+1)*gfont.fontwt, gfont.fontht + y*gfont.fontht), text +":")
if debugging:
self.draw_breakpoint(paint, text, gfont.fontht+y*gfont.fontht-9)
self.draw_breakpoint(paint, text, gfont.fontht+y*gfont.fontht-9)
y += editor.lines[i].height
i += 1
if (y+1)*gfont.fontht >= editor.geometry().height():
break

paint.end()

def draw_breakpoint(self, paint, line_no, y_pos):
def draw_breakpoint(self, paint, line_no, y_pos):
big_rect = QtCore.QRectF(0, y_pos, 8, 8)
small_rect = QtCore.QRectF(2, y_pos+2, 4, 4)

paint.setBrush(QColor("blue"))
breakpoints = self.parent().breakpoints

Expand All @@ -302,11 +302,11 @@ def draw_breakpoint(self, paint, line_no, y_pos):
paint.drawEllipse(big_rect)
move = True
if line_no in breakpoints['del']:
paint.setBrush(QColor("yellow"))
if move:
paint.drawEllipse(small_rect)
else:
paint.drawEllipse(big_rect)
paint.setBrush(QColor("yellow"))
if move:
paint.drawEllipse(small_rect)
else:
paint.drawEllipse(big_rect)

def update(self):
gfont = QApplication.instance().gfont
Expand Down
2 changes: 1 addition & 1 deletion lib/eco/export/PHPPython.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def language_box(self, name, node):
if name == "<Python + PHP>":
python = Python(self.source, self.lineno)
buf = python.pp(node)

if self.in_class():
classname = self.get_classname()
self.embed.append((classname, buf, self.lineno))
Expand Down
Loading

0 comments on commit 2ed80cd

Please sign in to comment.