[gedit-plugins/wip/python3] More fixes



commit 970b05e47eefde47be5731b7f44f1ae58eba770d
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Nov 6 19:45:19 2012 +0100

    More fixes

 plugins/commander/commander/commands/__init__.py   |    2 +-
 plugins/commander/commander/commands/completion.py |    2 +-
 plugins/commander/commander/entry.py               |    4 ++--
 plugins/commander/commander/info.py                |    4 ++--
 plugins/commander/modules/help.py                  |    2 +-
 plugins/commander/modules/shell.py                 |    5 +++--
 6 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/plugins/commander/commander/commands/__init__.py b/plugins/commander/commander/commands/__init__.py
index 60c38f6..49a1e90 100644
--- a/plugins/commander/commander/commands/__init__.py
+++ b/plugins/commander/commander/commands/__init__.py
@@ -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
 
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/entry.py b/plugins/commander/commander/entry.py
index f29c07e..dfdd789 100644
--- a/plugins/commander/commander/entry.py
+++ b/plugins/commander/commander/entry.py
@@ -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()
@@ -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()
diff --git a/plugins/commander/commander/info.py b/plugins/commander/commander/info.py
index b51b83d..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)
 
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/shell.py b/plugins/commander/modules/shell.py
index bc3d89b..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)



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