[gedit-plugins/wip/python3: 1/19] Port plugins to python 3



commit d39d84a9daf9021fcc45a8def6ad2b69c8675074
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Fri Oct 26 12:53:15 2012 +0200

    Port plugins to python 3

 plugins/charmap/charmap/__init__.py                |    2 +-
 plugins/commander/commander/commands/__init__.py   |   34 ++++++++++----------
 plugins/commander/commander/commands/completion.py |    2 +-
 plugins/commander/commander/commands/method.py     |    4 +-
 plugins/commander/commander/commands/module.py     |    6 ++--
 plugins/commander/commander/entry.py               |   16 +++++-----
 plugins/commander/commander/history.py             |    5 ++-
 plugins/commander/commander/info.py                |    8 ++--
 plugins/commander/modules/align.py                 |    6 ++--
 plugins/commander/modules/edit.py                  |    4 +-
 plugins/commander/modules/find/finder.py           |    6 ++--
 plugins/commander/modules/find/regex.py            |    4 +-
 plugins/commander/modules/format.py                |    4 +-
 plugins/commander/modules/grep.py                  |    2 +-
 plugins/commander/modules/help.py                  |    2 +-
 plugins/commander/modules/move.py                  |    4 +-
 plugins/commander/modules/shell.py                 |    7 ++--
 plugins/dashboard/dashboard/__init__.py            |    2 +-
 plugins/dashboard/dashboard/dashboard.py           |    6 ++--
 plugins/multiedit/multiedit/__init__.py            |    4 +-
 plugins/multiedit/multiedit/documenthelper.py      |   10 +++---
 plugins/synctex/synctex/__init__.py                |    2 +-
 plugins/synctex/synctex/evince_dbus.py             |    4 +-
 plugins/synctex/synctex/synctex.py                 |    2 +-
 plugins/textsize/textsize/__init__.py              |    2 +-
 plugins/textsize/textsize/documenthelper.py        |    2 +-
 26 files changed, 76 insertions(+), 74 deletions(-)
---
diff --git a/plugins/charmap/charmap/__init__.py b/plugins/charmap/charmap/__init__.py
index 61fbbbf..25b8c15 100644
--- a/plugins/charmap/charmap/__init__.py
+++ b/plugins/charmap/charmap/__init__.py
@@ -18,7 +18,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 from gi.repository import GObject, Gio, Pango, Gtk, Gedit, Gucharmap
-from panel import CharmapPanel
+from .panel import CharmapPanel
 import sys
 import gettext
 from gpdefs import *
diff --git a/plugins/commander/commander/commands/__init__.py b/plugins/commander/commander/commands/__init__.py
index c1a57ee..cfcfb6b 100644
--- a/plugins/commander/commander/commands/__init__.py
+++ b/plugins/commander/commander/commands/__init__.py
@@ -20,7 +20,7 @@
 #  Boston, MA 02110-1301, USA.
 
 import os
-from gi.repository import GObject, Gio
+from gi.repository import GLib, GObject, Gio
 import sys
 import bisect
 import types
@@ -28,14 +28,14 @@ import shlex
 import re
 import os
 
-import module
-import method
-import result
-import exceptions
-import metamodule
+import commands.module as module
+import commands.method as method
+import commands.result as result
+import commands.exceptions as exceptions
+import commands.metamodule as metamodule
 
-from accel_group import AccelGroup
-from accel_group import Accelerator
+from commands.accel_group import AccelGroup
+from commands.accel_group import Accelerator
 
 __all__ = ['is_commander_module', 'Commands', 'Accelerator']
 
@@ -111,7 +111,7 @@ class Commands(Singleton):
             if ret:
                 ct.retval = ct.generator.send(ret)
             else:
-                ct.retval = ct.generator.next()
+                ct.retval = next(ct.generator)
 
             return ct.retval
 
@@ -156,7 +156,7 @@ class Commands(Singleton):
         self._modules = None
 
         for k in self._timeouts:
-            GObject.source_remove(self._timeouts[k])
+            GLib.source_remove(self._timeouts[k])
 
         self._timeouts = {}
 
@@ -198,7 +198,7 @@ class Commands(Singleton):
 
         try:
             monitor = gfile.monitor_directory(Gio.FileMonitorFlags.NONE, None)
-        except Gio.Error, e:
+        except Gio.Error as e:
             # Could not create monitor, this happens on systems where file monitoring is
             # not supported, but we don't really care
             pass
@@ -275,7 +275,7 @@ class Commands(Singleton):
 
             if state:
                 return self.run(state)
-        except Exception, e:
+        except Exception as e:
             # Something error like, we throw on the parent generator
             state.pop()
 
@@ -405,9 +405,9 @@ class Commands(Singleton):
         # Now, try to reload the module
         try:
             mod.reload()
-        except Exception, e:
+        except Exception as e:
             # Reload failed, we remove the module
-            print 'Failed to reload module (%s):' % (mod.name,), e
+            print('Failed to reload module (%s):' % (mod.name,), e)
 
             self._modules.remove(mod)
             return
@@ -444,17 +444,17 @@ class Commands(Singleton):
                 return
 
             if path in self._timeouts:
-                GObject.source_remove(self._timeouts[path])
+                GLib.source_remove(self._timeouts[path])
 
             # We add a timeout because a common save strategy causes a
             # DELETE/CREATE event chain
-            self._timeouts[path] = GObject.timeout_add(500, self.on_timeout_delete, path, mod)
+            self._timeouts[path] = GLib.timeout_add(500, self.on_timeout_delete, path, mod)
         elif evnt == Gio.FileMonitorEvent.CREATED:
             path = gfile1.get_path()
 
             # Check if this CREATE followed a previous DELETE
             if path in self._timeouts:
-                GObject.source_remove(self._timeouts[path])
+                GLib.source_remove(self._timeouts[path])
                 del self._timeouts[path]
 
             # Reload the module
diff --git a/plugins/commander/commander/commands/completion.py b/plugins/commander/commander/commands/completion.py
index b76e98e..aed3c26 100644
--- a/plugins/commander/commander/commands/completion.py
+++ b/plugins/commander/commander/commands/completion.py
@@ -91,7 +91,7 @@ def _filter_command(cmd, subs):
     if len(subs) > len(parts):
         return False
 
-    for i in xrange(0, len(subs)):
+    for i in range(0, len(subs)):
         if not parts[i].startswith(subs[i]):
             return False
 
diff --git a/plugins/commander/commander/commands/method.py b/plugins/commander/commander/commands/method.py
index aa124e0..42acf52 100644
--- a/plugins/commander/commander/commands/method.py
+++ b/plugins/commander/commander/commands/method.py
@@ -19,11 +19,11 @@
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor,
 #  Boston, MA 02110-1301, USA.
 
-import exceptions
+import commands.exceptions as exceptions
 import types
 import inspect
 import sys
-import commander.utils as utils
+import utils
 
 class Method:
     def __init__(self, method, name, parent):
diff --git a/plugins/commander/commander/commands/module.py b/plugins/commander/commander/commands/module.py
index 112e579..0bd0346 100644
--- a/plugins/commander/commander/commands/module.py
+++ b/plugins/commander/commander/commands/module.py
@@ -25,9 +25,9 @@ import types
 import bisect
 
 import utils
-import exceptions
-import method
-import rollbackimporter
+import commands.exceptions as exceptions
+import commands.method as method
+import commands.rollbackimporter as rollbackimporter
 
 class Module(method.Method):
     def __init__(self, base, mod, parent=None):
diff --git a/plugins/commander/commander/entry.py b/plugins/commander/commander/entry.py
index 67f7f99..dfdd789 100644
--- a/plugins/commander/commander/entry.py
+++ b/plugins/commander/commander/entry.py
@@ -60,7 +60,7 @@ class Entry(Gtk.EventBox):
         self._entry.show()
 
         css = Gtk.CssProvider()
-        css.load_from_data("""
+        css.load_from_data(bytes("""
 @binding-set terminal-like-bindings {
     unbind "<Control>A";
 
@@ -82,7 +82,7 @@ GtkEntry#gedit-commander-entry {
     border-width: 0;
     box-shadow: 0 0 transparent;
 }
-""")
+""", 'utf-8'))
 
         # FIXME: remove hardcopy of 600 (GTK_STYLE_PROVIDER_PRIORITY_APPLICATION)
         # https://bugzilla.gnome.org/show_bug.cgi?id=646860
@@ -358,7 +358,7 @@ GtkEntry#gedit-commander-entry {
 
     def on_suspend_resume(self):
         if self._wait_timeout:
-            GObject.source_remove(self._wait_timeout)
+            GLib.source_remove(self._wait_timeout)
             self._wait_timeout = 0
         else:
             self._cancel_button.destroy()
@@ -389,7 +389,7 @@ GtkEntry#gedit-commander-entry {
 
         try:
             ret = cb()
-        except Exception, e:
+        except Exception as e:
             self.command_history_done()
             self._command_state.clear()
 
@@ -408,7 +408,7 @@ GtkEntry#gedit-commander-entry {
             self._suspended = ret
             ret.register(self.on_suspend_resume)
 
-            self._wait_timeout = GObject.timeout_add(500, self._show_wait_cancel)
+            self._wait_timeout = GLib.timeout_add(500, self._show_wait_cancel)
             self._entry.set_sensitive(False)
         else:
             self.command_history_done()
@@ -494,7 +494,7 @@ GtkEntry#gedit-commander-entry {
         #  * "hello world|"
         posidx = None
 
-        for idx in xrange(0, len(words)):
+        for idx in range(0, len(words)):
             spec = self._complete_word_match(words[idx])
 
             if words[idx].start(0) > pos:
@@ -582,10 +582,10 @@ GtkEntry#gedit-commander-entry {
                             del kwargs[k]
 
                 ret = func(**kwargs)
-            except Exception, e:
+            except Exception as e:
                 # Can be number of arguments, or return values or simply buggy
                 # modules
-                print e
+                print(e)
                 traceback.print_exc()
                 return True
 
diff --git a/plugins/commander/commander/history.py b/plugins/commander/commander/history.py
index 8544be6..f6ce8f4 100644
--- a/plugins/commander/commander/history.py
+++ b/plugins/commander/commander/history.py
@@ -72,7 +72,8 @@ class History:
 
     def load(self):
         try:
-            self._history = map(lambda x: x.strip("\n"), file(self._filename, 'r').readlines())
+            #FIXME: we should rewrite this
+            self._history = list(map(lambda x: x.strip("\n"), open(self._filename, 'r').readlines()))
             self._history.append('')
             self._ptr = len(self._history) - 1
         except IOError:
@@ -85,7 +86,7 @@ class History:
             pass
 
         try:
-            f = file(self._filename, 'w')
+            f = open(self._filename, 'w')
 
             if self._history[-1] == '':
                 hist = self._history[:-1]
diff --git a/plugins/commander/commander/info.py b/plugins/commander/commander/info.py
index ea32123..4f8d1a5 100644
--- a/plugins/commander/commander/info.py
+++ b/plugins/commander/commander/info.py
@@ -99,11 +99,11 @@ class Info(TransparentWindow):
         }
 
         css = Gtk.CssProvider()
-        css.load_from_data("""
+        css.load_from_data(bytes("""
 .trough {
     background: transparent;
 }
-""")
+""", 'utf-8'))
 
         self._vw.get_vscrollbar().get_style_context().add_provider(css, 600)
 
@@ -176,8 +176,8 @@ class Info(TransparentWindow):
 
         try:
             ret = Pango.parse_markup(line, -1, u'\x00')
-        except Exception, e:
-            print 'Could not parse markup:', e
+        except Exception as e:
+            print('Could not parse markup:', e)
             buf.insert(buf.get_end_iter(), line)
             return
 
diff --git a/plugins/commander/modules/align.py b/plugins/commander/modules/align.py
index ac792be..255fa6e 100644
--- a/plugins/commander/modules/align.py
+++ b/plugins/commander/modules/align.py
@@ -166,7 +166,7 @@ def _regex(view, reg, group, additional_ws, add_ws_group, flags=0):
     # Compile the regular expression
     try:
         reg = re.compile(reg, flags)
-    except Exception, e:
+    except Exception as e:
         raise commander.commands.exceptions.Execute('Failed to compile regular expression: %s' % (e,))
 
     # Query the user to provide a regex group number to align on
@@ -210,7 +210,7 @@ def _regex(view, reg, group, additional_ws, add_ws_group, flags=0):
     if not end.ends_line():
         end.forward_to_line_end()
 
-    lines = unicode(start.get_text(end), 'utf-8').splitlines()
+    lines = start.get_text(end).splitlines()
     newlines = []
     num = 0
     tabwidth = view.get_tab_width()
@@ -228,7 +228,7 @@ def _regex(view, reg, group, additional_ws, add_ws_group, flags=0):
             line.append(i, al + additional_ws, group, add_ws_group)
 
     # Replace lines
-    aligned = unicode.join(u'\n', [x.newline for x in newlines])
+    aligned = str.join('\n', [x.newline for x in newlines])
 
     buf.begin_user_action()
     buf.delete(bounds[0], bounds[1])
diff --git a/plugins/commander/modules/edit.py b/plugins/commander/modules/edit.py
index 271485c..756569e 100644
--- a/plugins/commander/modules/edit.py
+++ b/plugins/commander/modules/edit.py
@@ -106,7 +106,7 @@ def rename(view, newfile):
             # Create parent directories
             try:
                 os.makedirs(dest.get_parent().get_path())
-            except OSError, e:
+            except OSError as e:
                 raise commander.commands.exceptions.Execute('Could not create directory')
         else:
             yield commander.commands.result.HIDE
@@ -122,7 +122,7 @@ def rename(view, newfile):
 
         doc.set_location(dest)
         yield commander.commands.result.HIDE
-    except Exception, e:
+    except Exception as e:
         raise commander.commands.exceptions.Execute('Could not move file: %s' % (e,))
 
 def _mod_has_func(mod, func):
diff --git a/plugins/commander/modules/find/finder.py b/plugins/commander/modules/find/finder.py
index c1b030e..6c1270f 100644
--- a/plugins/commander/modules/find/finder.py
+++ b/plugins/commander/modules/find/finder.py
@@ -214,7 +214,7 @@ class Finder:
                         break
 
                 self.entry.info_show('<i>Search hit end of the document</i>', True)
-        except GeneratorExit, e:
+        except GeneratorExit as e:
             self.cancel()
             raise e
 
@@ -269,7 +269,7 @@ class Finder:
 
                 replacestr, words, modifier = (yield commands.result.Prompt('Replace with:'))
                 self.set_replace(replacestr)
-            except GeneratorExit, e:
+            except GeneratorExit as e:
                 if replaceall:
                     self._restore_cursor(startmark)
 
@@ -308,7 +308,7 @@ class Finder:
 
                     break
 
-        except GeneratorExit, e:
+        except GeneratorExit as e:
             if replaceall:
                 self._restore_cursor(startmark)
                 buf.end_user_action()
diff --git a/plugins/commander/modules/find/regex.py b/plugins/commander/modules/find/regex.py
index ed90d18..aaf2f95 100644
--- a/plugins/commander/modules/find/regex.py
+++ b/plugins/commander/modules/find/regex.py
@@ -39,7 +39,7 @@ class RegexFinder(finder.Finder):
 
         try:
             self.findre = re.compile(findstr, self.flags)
-        except Exception, e:
+        except Exception as e:
             raise commands.exceptions.Execute('Invalid regular expression: ' + str(e))
 
     def do_find(self, bounds):
@@ -96,7 +96,7 @@ class RegexFinder(finder.Finder):
     def get_replace(self, text):
         try:
             return self.findre.sub(self._do_re_replace, text)
-        except Exception, e:
+        except Exception as e:
             raise commands.exceptions.Execute('Invalid replacement: ' + str(e))
 
 class SemanticFinder(RegexFinder):
diff --git a/plugins/commander/modules/format.py b/plugins/commander/modules/format.py
index 0f90aa6..649822c 100644
--- a/plugins/commander/modules/format.py
+++ b/plugins/commander/modules/format.py
@@ -73,8 +73,8 @@ the open documents."""
                 start = end.copy()
                 start.forward_line()
 
-        except Exception, e:
-            print e
+        except Exception as e:
+            print(e)
 
         buf.delete_mark(until)
         buf.end_user_action()
diff --git a/plugins/commander/modules/grep.py b/plugins/commander/modules/grep.py
index 2fde969..4055c72 100644
--- a/plugins/commander/modules/grep.py
+++ b/plugins/commander/modules/grep.py
@@ -126,7 +126,7 @@ def _grep(view, regex, match_action, non_match_action):
 
     try:
         reg = re.compile(regex)
-    except Exception, e:
+    except Exception as e:
         raise commands.exceptions.Execute('Invalid regular expression: ' + str(e))
 
     while True:
diff --git a/plugins/commander/modules/help.py b/plugins/commander/modules/help.py
index 534c3ad..b0a799e 100644
--- a/plugins/commander/modules/help.py
+++ b/plugins/commander/modules/help.py
@@ -37,7 +37,7 @@ def _name_match(first, second):
     if len(first) > len(second):
         return False
 
-    for i in xrange(0, len(first)):
+    for i in range(0, len(first)):
         if not second[i].startswith(first[i]):
             return False
 
diff --git a/plugins/commander/modules/move.py b/plugins/commander/modules/move.py
index 0c7625d..87addcf 100644
--- a/plugins/commander/modules/move.py
+++ b/plugins/commander/modules/move.py
@@ -64,12 +64,12 @@ def regex(view, modifier, regex, num=1):
 Move the cursor per regex (use negative num to move backwards)"""
     try:
         r = re.compile(regex, re.DOTALL | re.MULTILINE | re.UNICODE)
-    except Exception, e:
+    except Exception as e:
         raise commands.exceptions.Execute('Invalid regular expression: ' + str(e))
 
     try:
         num = int(num)
-    except Exception, e:
+    except Exception as e:
         raise commands.exceptions.Execute('Invalid number: ' + str(e))
 
     buf = view.get_buffer()
diff --git a/plugins/commander/modules/shell.py b/plugins/commander/modules/shell.py
index 8905fa4..94f4610 100644
--- a/plugins/commander/modules/shell.py
+++ b/plugins/commander/modules/shell.py
@@ -48,7 +48,8 @@ class Process:
             fcntl.fcntl(stdout, fcntl.F_SETFL, os.O_NONBLOCK)
             conditions = GLib.IOCondition.IN | GLib.IOCondition.PRI | GLib.IOCondition.ERR | GLib.IOCondition.HUP
 
-            self.watch = GLib.io_add_watch(stdout, conditions, self.collect_output)
+            channel = GLib.IOChannel.unix_new(stdout.fileno())
+            self.watch = GLib.io_add_watch(channel, GLib.PRIORITY_DEFAULT, conditions, self.collect_output)
             self._buffer = ''
         else:
             stdout.close()
@@ -106,7 +107,7 @@ class Process:
         if hasattr(self.pipe, 'kill'):
             self.pipe.kill()
 
-        GObject.source_remove(self.watch)
+        GLib.source_remove(self.watch)
 
         if self.replace:
             self.entry.view().set_editable(True)
@@ -148,7 +149,7 @@ def _run_command(entry, replace, background, argstr):
         p = subprocess.Popen(argstr, shell=True, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
         stdout = p.stdout
 
-    except Exception, e:
+    except Exception as e:
         raise commander.commands.exceptions.Execute('Failed to execute: ' + e)
 
     suspend = None
diff --git a/plugins/dashboard/dashboard/__init__.py b/plugins/dashboard/dashboard/__init__.py
index b02625f..f46771a 100644
--- a/plugins/dashboard/dashboard/__init__.py
+++ b/plugins/dashboard/dashboard/__init__.py
@@ -20,7 +20,7 @@
 #
 
 from gi.repository import GObject, Gedit
-from dashboard import Dashboard
+from .dashboard import Dashboard
 
 class DashboardWindowActivatable(GObject.Object, Gedit.WindowActivatable):
 
diff --git a/plugins/dashboard/dashboard/dashboard.py b/plugins/dashboard/dashboard/dashboard.py
index d39532e..2f56c2c 100644
--- a/plugins/dashboard/dashboard/dashboard.py
+++ b/plugins/dashboard/dashboard/dashboard.py
@@ -22,7 +22,7 @@
 from gi.repository import GObject, Gedit, Gtk, Gio, GLib, GdkPixbuf, GtkSource
 from zeitgeist.client import ZeitgeistClient
 from zeitgeist.datamodel import Event, TimeRange
-from utils import *
+from .utils import *
 
 import time
 import os
@@ -39,7 +39,7 @@ CLIENT = ZeitgeistClient()
 version = [int(x) for x in CLIENT.get_version()]
 MIN_VERSION = [0, 8, 0, 0]
 if version < MIN_VERSION:
-    print "PLEASE USE ZEITGEIST 0.8.0 or above"
+    print("PLEASE USE ZEITGEIST 0.8.0 or above")
 
 class Item(Gtk.Button):
 
@@ -423,7 +423,7 @@ class Dashboard (Gtk.Box):
     def _on_search(self, widget, query):
         self.search_result_box.show()
         self.dash_box.hide()
-        print "Dashboard search for:", query
+        print("Dashboard search for:", query)
         ZG_FTS.search(query, self.tree_view.insert_results)
         self.last_used_button.set_active(False)
 
diff --git a/plugins/multiedit/multiedit/__init__.py b/plugins/multiedit/multiedit/__init__.py
index 2dbfc87..73abc6c 100644
--- a/plugins/multiedit/multiedit/__init__.py
+++ b/plugins/multiedit/multiedit/__init__.py
@@ -20,8 +20,8 @@
 #  Boston, MA 02110-1301, USA.
 
 from gi.repository import GObject, Gtk, Gedit
-from signals import Signals
-from documenthelper import DocumentHelper
+from .signals import Signals
+from .documenthelper import DocumentHelper
 import gettext
 from gpdefs import *
 
diff --git a/plugins/multiedit/multiedit/documenthelper.py b/plugins/multiedit/multiedit/documenthelper.py
index 131d6e1..f7caf4a 100644
--- a/plugins/multiedit/multiedit/documenthelper.py
+++ b/plugins/multiedit/multiedit/documenthelper.py
@@ -22,8 +22,8 @@
 import re
 import time
 import xml.sax.saxutils
-from gi.repository import GObject, Pango, PangoCairo, Gdk, Gtk, Gedit
-from signals import Signals
+from gi.repository import GLib, GObject, Pango, PangoCairo, Gdk, Gtk, Gedit
+from .signals import Signals
 import gettext
 from gpdefs import *
 
@@ -161,7 +161,7 @@ class DocumentHelper(Signals):
         ]
 
         for handler in self._event_handlers:
-            handler[0] = map(lambda x: Gdk.keyval_from_name(x), handler[0])
+            handler[0] = list(map(lambda x: Gdk.keyval_from_name(x), handler[0]))
 
     def disable_multi_edit(self):
         if self._column_mode:
@@ -354,9 +354,9 @@ class DocumentHelper(Signals):
         self._invalidate_status()
 
         if self._status_timeout != 0:
-            GObject.source_remove(self._status_timeout)
+            GLib.source_remove(self._status_timeout)
 
-        self._status_timeout = GObject.timeout_add(3000, self._remove_status)
+        self._status_timeout = GLib.timeout_add(3000, self._remove_status)
 
     def _apply_column_mode(self):
         mode = self._column_mode
diff --git a/plugins/synctex/synctex/__init__.py b/plugins/synctex/synctex/__init__.py
index 5aa4425..e8217b3 100644
--- a/plugins/synctex/synctex/__init__.py
+++ b/plugins/synctex/synctex/__init__.py
@@ -1 +1 @@
-from synctex import SynctexWindowActivatable
+from .synctex import SynctexWindowActivatable
diff --git a/plugins/synctex/synctex/evince_dbus.py b/plugins/synctex/synctex/evince_dbus.py
index 3c1957b..ba6aaea 100755
--- a/plugins/synctex/synctex/evince_dbus.py
+++ b/plugins/synctex/synctex/evince_dbus.py
@@ -145,9 +145,9 @@ if __name__ == '__main__':
     from gi.repository import GObject
 
     def print_usage():
-        print '''
+        print('''
 The usage is evince_dbus output_file line_number input_file from the directory of output_file.
-'''
+''')
         sys.exit(1)
 
     if len(sys.argv)!=4:
diff --git a/plugins/synctex/synctex/synctex.py b/plugins/synctex/synctex/synctex.py
index ec130ef..d5ac9dc 100644
--- a/plugins/synctex/synctex/synctex.py
+++ b/plugins/synctex/synctex/synctex.py
@@ -20,7 +20,7 @@
 #  Boston, MA 02110-1301, USA.
 
 from gi.repository import GObject, Pango, Gtk, Gedit, Peas, PeasGtk, Gio, Gdk
-from evince_dbus import EvinceWindowProxy
+from .evince_dbus import EvinceWindowProxy
 import dbus.mainloop.glib
 import logging
 import gettext
diff --git a/plugins/textsize/textsize/__init__.py b/plugins/textsize/textsize/__init__.py
index 320b3a0..2d853c8 100644
--- a/plugins/textsize/textsize/__init__.py
+++ b/plugins/textsize/textsize/__init__.py
@@ -23,7 +23,7 @@
 #  Boston, MA 02110-1301, USA.
 
 from gi.repository import GObject, Gtk, Gdk, Gedit
-from documenthelper import DocumentHelper
+from .documenthelper import DocumentHelper
 import gettext
 from gpdefs import *
 
diff --git a/plugins/textsize/textsize/documenthelper.py b/plugins/textsize/textsize/documenthelper.py
index bf4435c..ba9ca61 100644
--- a/plugins/textsize/textsize/documenthelper.py
+++ b/plugins/textsize/textsize/documenthelper.py
@@ -19,7 +19,7 @@
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor,
 #  Boston, MA 02110-1301, USA.
 
-from signals import Signals
+from .signals import Signals
 from gi.repository import Gtk, Gdk, Pango
 
 class DocumentHelper(Signals):



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