[meld/precommit: 9/11] Fix some flake8 naming
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/precommit: 9/11] Fix some flake8 naming
- Date: Sat, 5 Oct 2019 22:02:12 +0000 (UTC)
commit 3090146fd4f626a40c86f0709b43d7fcb69d6543
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Oct 6 07:27:58 2019 +1000
Fix some flake8 naming
maint | 4 ++--
meld/matchers/diffutil.py | 3 ++-
meld/matchers/merge.py | 5 ++---
3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/maint b/maint
index 72db0370..3e56245a 100755
--- a/maint
+++ b/maint
@@ -274,8 +274,8 @@ def render_template(template):
def call_with_output(
cmd, stdin_text=None, echo_stdout=True, abort_on_fail=True,
timeout=30):
- PIPE = subprocess.PIPE
- with subprocess.Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc:
+ pipe = subprocess.PIPE
+ with subprocess.Popen(cmd, stdin=pipe, stdout=pipe, stderr=pipe) as proc:
stdout, stderr = proc.communicate(stdin_text, timeout=timeout)
if stdout and echo_stdout:
click.echo('\n' + stdout.decode('utf-8'))
diff --git a/meld/matchers/diffutil.py b/meld/matchers/diffutil.py
index 2ac87c26..51a65130 100644
--- a/meld/matchers/diffutil.py
+++ b/meld/matchers/diffutil.py
@@ -22,6 +22,8 @@ from meld.matchers.myers import (
SyncPointMyersSequenceMatcher,
)
+LO, HI = 1, 2
+
opcode_reverse = {
"replace": "replace",
"insert": "delete",
@@ -425,7 +427,6 @@ class Differ(GObject.GObject):
return self.diffs == [[], []] and self._initialised
def _merge_blocks(self, using):
- LO, HI = 1, 2
lowc = min(using[0][0][LO], using[1][0][LO])
highc = max(using[0][-1][HI], using[1][-1][HI])
low = []
diff --git a/meld/matchers/merge.py b/meld/matchers/merge.py
index d456a48e..cf239c08 100644
--- a/meld/matchers/merge.py
+++ b/meld/matchers/merge.py
@@ -16,6 +16,8 @@
from meld.matchers import diffutil
from meld.matchers.myers import MyersSequenceMatcher
+LO, HI = 1, 2
+
class AutoMergeDiffer(diffutil.Differ):
@@ -217,7 +219,6 @@ class Merger(diffutil.Differ):
yield 1
def _apply_change(self, text, change, mergedtext):
- LO, HI = 1, 2
if change[0] == 'insert':
for i in range(change[LO + 2], change[HI + 2]):
mergedtext.append(text[i])
@@ -230,7 +231,6 @@ class Merger(diffutil.Differ):
return change[HI] - change[LO]
def merge_3_files(self, mark_conflicts=True):
- LO, HI = 1, 2
self.unresolved = []
lastline = 0
mergedline = 0
@@ -278,7 +278,6 @@ class Merger(diffutil.Differ):
yield "\n".join(mergedtext)
def merge_2_files(self, fromindex, toindex):
- LO, HI = 1, 2
self.unresolved = []
lastline = 0
mergedtext = []
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]