[meld] Minor PEP8 fixes
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Minor PEP8 fixes
- Date: Sat, 18 Nov 2017 22:19:23 +0000 (UTC)
commit 6f928ff9174b7ca36308a3dff3643c6fd9280cf2
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Nov 17 08:04:43 2017 +1000
Minor PEP8 fixes
meld/build_helpers.py | 2 +-
meld/linkmap.py | 17 +++++++++++------
meld/misc.py | 2 +-
3 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/meld/build_helpers.py b/meld/build_helpers.py
index a7f23d5..c8bdac9 100644
--- a/meld/build_helpers.py
+++ b/meld/build_helpers.py
@@ -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')
diff --git a/meld/linkmap.py b/meld/linkmap.py
index f7f7e63..15a8471 100644
--- a/meld/linkmap.py
+++ b/meld/linkmap.py
@@ -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]]
diff --git a/meld/misc.py b/meld/misc.py
index f368eab..04579cd 100644
--- a/meld/misc.py
+++ b/meld/misc.py
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]