[meld] gutterrendererchunk: Move action map into class
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] gutterrendererchunk: Move action map into class
- Date: Sat, 26 Apr 2014 23:44:47 +0000 (UTC)
commit 47146d893db9498dfc8e5370b1ad9c0b6c9ad03b
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Apr 25 08:14:05 2014 +1000
gutterrendererchunk: Move action map into class
meld/gutterrendererchunk.py | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 8ae8575..121a2a5 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -30,23 +30,24 @@ pixbuf_copy = load("meld-change-copy")
# FIXME: import order issues
MODE_REPLACE, MODE_DELETE, MODE_INSERT = 0, 1, 2
-ACTION_MAP = {
- 'LTR': {
- MODE_REPLACE: pixbuf_apply0,
- MODE_DELETE: pixbuf_delete,
- MODE_INSERT: pixbuf_copy,
- },
- 'RTL': {
- MODE_REPLACE: pixbuf_apply1,
- MODE_DELETE: pixbuf_delete,
- MODE_INSERT: pixbuf_copy,
- }
-}
class GutterRendererChunkAction(GtkSource.GutterRendererPixbuf):
__gtype_name__ = "GutterRendererChunkAction"
+ ACTION_MAP = {
+ 'LTR': {
+ MODE_REPLACE: pixbuf_apply0,
+ MODE_DELETE: pixbuf_delete,
+ MODE_INSERT: pixbuf_copy,
+ },
+ 'RTL': {
+ MODE_REPLACE: pixbuf_apply1,
+ MODE_DELETE: pixbuf_delete,
+ MODE_INSERT: pixbuf_copy,
+ }
+ }
+
def __init__(self, from_pane, to_pane, views, filediff, linediffer):
super(GutterRendererChunkAction, self).__init__()
self.from_pane = from_pane
@@ -59,7 +60,7 @@ class GutterRendererChunkAction(GtkSource.GutterRendererPixbuf):
self.mode = MODE_REPLACE
self.set_size(line_height)
direction = 'LTR' if from_pane < to_pane else 'RTL'
- self.action_map = ACTION_MAP[direction]
+ self.action_map = self.ACTION_MAP[direction]
self.filediff = filediff
self.filediff.connect("action-mode-changed",
self.on_container_mode_changed)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]