Commit 6f928ff9 authored by Kai Willadsen's avatar Kai Willadsen

Minor PEP8 fixes

parent 486055f8
......@@ -339,7 +339,7 @@ class build_py(distutils.command.build_py.build_py):
options = self.distribution.get_option_dict('install')
prefix = options['prefix'][1]
except KeyError as e:
print (e)
print(e)
prefix = sys.prefix
datadir = os.path.join(prefix, 'share', 'meld')
......
......@@ -67,10 +67,12 @@ class LinkMap(Gtk.DrawingArea):
context.set_line_width(1.0)
height = allocation.height
visible = [self.views[0].get_line_num_for_y(pix_start[0]),
self.views[0].get_line_num_for_y(pix_start[0] + height),
self.views[1].get_line_num_for_y(pix_start[1]),
self.views[1].get_line_num_for_y(pix_start[1] + height)]
visible = [
self.views[0].get_line_num_for_y(pix_start[0]),
self.views[0].get_line_num_for_y(pix_start[0] + height),
self.views[1].get_line_num_for_y(pix_start[1]),
self.views[1].get_line_num_for_y(pix_start[1] + height),
]
wtotal = allocation.width
# For bezier control points
......@@ -78,8 +80,11 @@ class LinkMap(Gtk.DrawingArea):
q_rad = math.pi / 2
left, right = self.view_indices
view_offset_line = lambda v, l: (self.views[v].get_y_for_line_num(l) -
pix_start[v] + y_offset[v])
def view_offset_line(view_idx, line_num):
line_start = self.views[view_idx].get_y_for_line_num(line_num)
return line_start - pix_start[view_idx] + y_offset[view_idx]
for c in self.filediff.linediffer.pair_changes(left, right, visible):
# f and t are short for "from" and "to"
f0, f1 = [view_offset_line(0, l) for l in c[1:3]]
......
......@@ -27,7 +27,6 @@ import subprocess
from gi.repository import Gdk
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import GtkSource
......@@ -182,6 +181,7 @@ def get_base_style_scheme():
return base_style_scheme
base_style_scheme = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment