summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to 'portato')
-rw-r--r--portato/backend/catapult/package.py12
-rw-r--r--portato/gui/gtk/windows.py35
2 files changed, 18 insertions, 29 deletions
diff --git a/portato/backend/catapult/package.py b/portato/backend/catapult/package.py
index 32ea379..b5f3539 100644
--- a/portato/backend/catapult/package.py
+++ b/portato/backend/catapult/package.py
@@ -25,14 +25,10 @@ from gettext import lgettext as _
class CatapultPackage(Package):
- def __init__ (self, cpv):
- Package.__init__(self, cpv)
-
- self.bus = dbus.SessionBus()
- # get the system
- po = self.bus.get_object("org.gentoo.catapult.portage", "/org/gentoo/catapult/Package")
- self.proxy = dbus.Interface(po, "org.gentoo.catapult.Package")
-
+ bus = dbus.SessionBus()
+ dbus_object = bus.get_object("org.gentoo.catapult.portage", "/org/gentoo/catapult/Package")
+ proxy = dbus.Interface(dbus_object, "org.gentoo.catapult.Package")
+
def use_expanded (self, flag, suggest = None):
if not suggest:
suggest = ""
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index 456d962..e3bf133 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -15,10 +15,7 @@ from __future__ import absolute_import
# gtk stuff
import gtk
import gobject
-try:
- import gtksourceview2
-except ImportError:
- gtksourceview2 = None
+import gtksourceview2
# other
import types, logging
@@ -385,23 +382,19 @@ class EbuildWindow (AbstractDialog):
def _build_view(self):
"""Creates the buffer and the view."""
- if gtksourceview2 is None:
- self.buf = gtk.TextBuffer()
- self.view = gtk.TextView(self.buf)
- else:
- man = gtksourceview2.LanguageManager()
- man.set_search_path(man.get_search_path()+[DATA_DIR])
- language = man.get_language("ebuild")
-
- if language is None:
- warning(_("No ebuild language file installed. Falling back to shell."))
- language = man.get_language("sh")
-
- # set buffer and view
- self.buf = gtksourceview2.Buffer()
- self.buf.set_language(language)
- #self.buf.set_highlight(True)
- self.view = gtksourceview2.View(self.buf)
+ man = gtksourceview2.LanguageManager()
+ man.set_search_path(man.get_search_path()+[DATA_DIR])
+ language = man.get_language("ebuild")
+
+ if language is None:
+ warning(_("No ebuild language file installed. Falling back to shell."))
+ language = man.get_language("sh")
+
+ # set buffer and view
+ self.buf = gtksourceview2.Buffer()
+ self.buf.set_language(language)
+ #self.buf.set_highlight(True)
+ self.view = gtksourceview2.View(self.buf)
def _show (self):
"""Fill the buffer with content and shows the window."""