[meld] Add forward-compatibility for unicode literals



commit 334077b3479577cd82f0502285404ad25c97df95
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Oct 27 12:07:32 2012 +1000

    Add forward-compatibility for unicode literals

 meld/meldbuffer.py |    8 +++++---
 meld/vcview.py     |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/meld/meldbuffer.py b/meld/meldbuffer.py
index d3bb477..286e727 100644
--- a/meld/meldbuffer.py
+++ b/meld/meldbuffer.py
@@ -16,6 +16,8 @@
 ### Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
 ### USA.
 
+from __future__ import unicode_literals
+
 import sys
 from gettext import gettext as _
 
@@ -126,14 +128,14 @@ class BufferLines(object):
         if hi >= self.buf.get_line_count() and \
            lo < self.buf.get_line_count() and \
            (len(lines) == 0 or len(lines[-1]) != len(ends[-1])):
-            lines.append(u"")
-            ends.append(u"")
+            lines.append("")
+            ends.append("")
 
         hi = self.buf.get_line_count() if hi == sys.maxint else hi
         if hi - lo != len(lines):
             # These codepoints are considered line breaks by Python, but not
             # by GtkTextStore.
-            additional_breaks = set((u'\x0c', u'\x85'))
+            additional_breaks = set(('\x0c', '\x85'))
             i = 0
             while i < len(ends):
                 line, end = lines[i], ends[i]
diff --git a/meld/vcview.py b/meld/vcview.py
index b2fc0ae..31ef142 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -484,7 +484,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
            command was executed in and the output of the command.
         """
         msg = misc.shelljoin(command)
-        yield "[%s] %s" % (self.label_text, msg.replace("\n", u"\u21b2") )
+        yield "[%s] %s" % (self.label_text, msg.replace("\n", "\t"))
         def relpath(pbase, p):
             kill = 0
             if len(pbase) and p.startswith(pbase):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]