diff options
Diffstat (limited to '')
-rwxr-xr-x | portato.py | 8 | ||||
-rw-r--r-- | portato/backend/portage/system.py | 18 | ||||
-rw-r--r-- | portato/gui/exception_handling.py | 1 | ||||
-rw-r--r-- | portato/gui/templates/AboutWindow.glade | 4 | ||||
-rw-r--r-- | portato/gui/templates/MainWindow.glade | 194 | ||||
-rw-r--r-- | portato/gui/templates/UpdateWindow.glade | 4 | ||||
-rw-r--r-- | portato/gui/utils.py | 2 | ||||
-rw-r--r-- | portato/gui/windows/main.py | 6 | ||||
-rw-r--r-- | portato/plistener.py | 8 | ||||
-rw-r--r-- | portato/plugins/dbus_init.py | 10 |
10 files changed, 131 insertions, 124 deletions
@@ -73,13 +73,7 @@ def main (): else: # start us again in root modus and launch listener - try: # local version - from _shm import shm_wrapper as shm - except ImportError: - try: # version installed together with portato - from portato._shm import shm_wrapper as shm - except ImportError: # the normal shm module - import shm_wrapper as shm + import shm_wrapper as shm mem = shm.create_memory(1024, permissions=0600) sig = shm.create_semaphore(InitialValue = 0, permissions = 0600) diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index d0a0bc3..fa4fece 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -31,11 +31,13 @@ class PortageSystem (SystemInterface): def __init__ (self): """Constructor.""" self.settings = PortageSettings() - portage.WORLD_FILE = os.path.join(self.settings.settings["ROOT"], portage.WORLD_FILE) + portage.WORLD_FILE = os.path.join(self.settings.settings["ROOT"],portage.WORLD_FILE) self.use_descs = {} self.local_use_descs = defaultdict(dict) + self._version = tuple([x.split("_")[0] for x in portage.VERSION.split(".")]) + def get_version (self): return "Portage %s" % portage.VERSION @@ -155,18 +157,24 @@ class PortageSystem (SystemInterface): return PortagePackage(portage.best(list)) def find_best_match (self, search_key, masked = False, only_installed = False, only_cpv = False): - t = None - + t = [] + if not only_installed: pkgSet = "tree" else: pkgSet = "installed" t = self.find_packages(search_key, pkgSet = pkgSet, masked = masked, with_version = True, only_cpv = True) + + if self._version >= (2,1,5): + t += [pkg.get_cpv() for pkg in self.find_installed_packages(search_key) if not (pkg.is_testing(True) or pkg.is_masked())] if t: + t = unique_array(t) return self.find_best(t, only_cpv) + return None + def find_packages (self, key = "", pkgSet = "all", masked = False, with_version = True, only_cpv = False): if key is None: key = "" @@ -355,7 +363,7 @@ class PortageSystem (SystemInterface): # append system packages packages.extend(unique_array([p.get_cp() for p in self.find_packages(pkgSet = "system")])) - states = [(["RDEPEND"], True)] + states = [(["RDEPEND", "PDEPEND"], True)] if self.with_bdeps(): states.append((["DEPEND"], True)) @@ -431,7 +439,7 @@ class PortageSystem (SystemInterface): else: for pkg in bm: if not pkg: continue - if pkg.is_masked() or pkg.is_testing(True): # check to not update unnecessairily + if not pkg.is_installed() and (pkg.is_masked() or pkg.is_testing(True)): # check to not update unnecessairily cont = False for inst in self.find_packages(pkg.get_cp(), "installed", only_cpv = True): if self.cpv_matches(inst, i): diff --git a/portato/gui/exception_handling.py b/portato/gui/exception_handling.py index 6bda133..29cd4e6 100644 --- a/portato/gui/exception_handling.py +++ b/portato/gui/exception_handling.py @@ -118,6 +118,7 @@ def get_version_infos(): return "\n".join(( "Portato version: %s" % VERSION, + "Python version: %s" % sys.version, "Used backend: %s" % system.get_version(), "pygtk: %s (using GTK+: %s)" % (convert(gtk.pygtk_version), convert(gtk.gtk_version)), "pygobject: %s (using GLib: %s)" % (convert(gobject.pygobject_version), convert(gobject.glib_version)), diff --git a/portato/gui/templates/AboutWindow.glade b/portato/gui/templates/AboutWindow.glade index 57708d9..d5cfbef 100644 --- a/portato/gui/templates/AboutWindow.glade +++ b/portato/gui/templates/AboutWindow.glade @@ -16,7 +16,7 @@ <property name="has_separator">False</property> <property name="program_name">Portato</property> <property name="copyright" translatable="yes">This software is licensed under the terms of the GPLv2. -Copyright (C) 2006-2007 René 'Necoro' Neumann <necoro@necoro.net></property> +Copyright (C) 2006-2008 René 'Necoro' Neumann <necoro@necoro.net></property> <property name="comments">A Portage GUI</property> <property name="website">http://portato.necoro.net</property> <property name="authors">René 'Necoro' Neumann @@ -28,7 +28,7 @@ Thanks goto: <property name="translator_credits">Catalan - Roger Calvó German - René 'Necoro' Neumann Polish - Tomasz Osiński -Turkish - Gürkan Gür</property> +Turkish - Gürkan 'seqizz' Gür</property> <property name="artists">p4r4d0x (inspired by wolfden)</property> <signal name="response" handler="close"/> <child internal-child="vbox"> diff --git a/portato/gui/templates/MainWindow.glade b/portato/gui/templates/MainWindow.glade index 7422126..788a339 100644 --- a/portato/gui/templates/MainWindow.glade +++ b/portato/gui/templates/MainWindow.glade @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> -<!--Generated with glade3 3.4.3 on Fri Apr 11 14:08:36 2008 --> +<!--Generated with glade3 3.4.3 on Mon Apr 21 23:09:43 2008 --> <glade-interface> <widget class="GtkWindow" id="MainWindow"> <property name="border_width">2</property> @@ -46,6 +46,8 @@ <property name="label" translatable="yes">Re_load Portage</property> <property name="use_underline">True</property> <signal name="activate" handler="cb_reload_clicked"/> + <accelerator key="R" modifiers="GDK_CONTROL_MASK" signal="activate"/> + <accelerator key="F5" modifiers="" signal="activate"/> <child internal-child="image"> <widget class="GtkImage" id="menu-item-image9"> <property name="visible">True</property> @@ -614,271 +616,271 @@ <placeholder/> </child> <child> - <widget class="GtkLabel" id="licenseLabel"> + <widget class="GtkLabel" id="useFlagsLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="no_show_all">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">label</property> + <property name="label">use flags</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> <property name="single_line_mode">True</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="licenseLabelLabel"> + <widget class="GtkLabel" id="useFlagsLabelLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="no_show_all">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes"><b>License:</b></property> + <property name="label" translatable="yes"><b>Use Flags:</b></property> <property name="use_markup">True</property> <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> <property name="y_padding">5</property> </packing> </child> <child> - <widget class="GtkLabel" id="notInSysLabel"> + <widget class="GtkCheckButton" id="testingCheck"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="no_show_all">True</property> - <property name="label" translatable="yes"><b>Installed, but not in portage anymore</b></property> - <property name="use_markup">True</property> + <property name="label" translatable="yes">Testing</property> + <property name="xalign">0</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="cb_testing_toggled"/> </widget> <packing> - <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="missingLabel"> + <widget class="GtkLabel" id="maskedLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="no_show_all">True</property> - <property name="label" translatable="yes"><span foreground='red'><b>MISSING KEYWORD</b></span></property> - <property name="use_markup">True</property> + <property name="xalign">0</property> </widget> <packing> + <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkHBox" id="linkBox"> + <widget class="GtkCheckButton" id="maskedCheck"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="spacing">5</property> - <child> - <placeholder/> - </child> + <property name="no_show_all">True</property> + <property name="label" translatable="yes">Masked</property> + <property name="xalign">0</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="cb_masked_toggled"/> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> + <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="descLabelLabel"> + <widget class="GtkCheckButton" id="installedCheck"> <property name="visible">True</property> + <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes">Installed</property> <property name="xalign">0</property> - <property name="label" translatable="yes"><b>Description:</b></property> - <property name="use_markup">True</property> - <property name="single_line_mode">True</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + <signal name="button_press_event" handler="cb_button_pressed"/> </widget> <packing> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> - <property name="y_padding">5</property> </packing> </child> <child> - <widget class="GtkLabel" id="overlayLabelLabel"> + <widget class="GtkLabel" id="homepageLinkLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="no_show_all">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes"><b>Overlay:</b></property> + <property name="label" translatable="yes"><b>Homepage:</b></property> <property name="use_markup">True</property> <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> <property name="y_padding">5</property> </packing> </child> <child> - <widget class="GtkLabel" id="descLabel"> + <widget class="GtkLabel" id="overlayLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="no_show_all">True</property> <property name="xalign">0</property> <property name="label" translatable="yes">label</property> - <property name="wrap">True</property> + <property name="single_line_mode">True</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="overlayLabel"> + <widget class="GtkLabel" id="descLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="no_show_all">True</property> <property name="xalign">0</property> <property name="label" translatable="yes">label</property> - <property name="single_line_mode">True</property> + <property name="wrap">True</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="homepageLinkLabel"> + <widget class="GtkLabel" id="overlayLabelLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="no_show_all">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes"><b>Homepage:</b></property> + <property name="label" translatable="yes"><b>Overlay:</b></property> <property name="use_markup">True</property> <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> <property name="y_padding">5</property> </packing> </child> <child> - <widget class="GtkCheckButton" id="installedCheck"> + <widget class="GtkLabel" id="descLabelLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="no_show_all">True</property> - <property name="label" translatable="yes">Installed</property> <property name="xalign">0</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - <signal name="button_press_event" handler="cb_button_pressed"/> + <property name="label" translatable="yes"><b>Description:</b></property> + <property name="use_markup">True</property> + <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> + <property name="y_padding">5</property> </packing> </child> <child> - <widget class="GtkCheckButton" id="maskedCheck"> + <widget class="GtkHBox" id="linkBox"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="no_show_all">True</property> - <property name="label" translatable="yes">Masked</property> - <property name="xalign">0</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="cb_masked_toggled"/> + <property name="spacing">5</property> + <child> + <placeholder/> + </child> </widget> <packing> - <property name="top_attach">8</property> - <property name="bottom_attach">9</property> - <property name="x_options">GTK_FILL</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="maskedLabel"> + <widget class="GtkLabel" id="missingLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="xalign">0</property> + <property name="no_show_all">True</property> + <property name="label" translatable="yes"><span foreground='red'><b>MISSING KEYWORD</b></span></property> + <property name="use_markup">True</property> </widget> <packing> - <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">8</property> - <property name="bottom_attach">9</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkCheckButton" id="testingCheck"> + <widget class="GtkLabel" id="notInSysLabel"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="no_show_all">True</property> - <property name="label" translatable="yes">Testing</property> - <property name="xalign">0</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="cb_testing_toggled"/> + <property name="label" translatable="yes"><b>Installed, but not in portage anymore</b></property> + <property name="use_markup">True</property> </widget> <packing> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> - <property name="x_options">GTK_FILL</property> + <property name="right_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="useFlagsLabelLabel"> + <widget class="GtkLabel" id="licenseLabelLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="no_show_all">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes"><b>Use Flags:</b></property> + <property name="label" translatable="yes"><b>License:</b></property> <property name="use_markup">True</property> <property name="single_line_mode">True</property> </widget> <packing> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> <property name="y_padding">5</property> </packing> </child> <child> - <widget class="GtkLabel" id="useFlagsLabel"> + <widget class="GtkLabel" id="licenseLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="no_show_all">True</property> <property name="xalign">0</property> - <property name="label">use flags</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="label" translatable="yes">label</property> <property name="single_line_mode">True</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="y_options"></property> </packing> </child> diff --git a/portato/gui/templates/UpdateWindow.glade b/portato/gui/templates/UpdateWindow.glade index 4cc678a..2bf712e 100644 --- a/portato/gui/templates/UpdateWindow.glade +++ b/portato/gui/templates/UpdateWindow.glade @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> -<!--Generated with glade3 3.4.1 on Fri Feb 29 00:02:28 2008 --> +<!--Generated with glade3 3.4.4 on Thu May 15 21:45:30 2008 --> <glade-interface> <widget class="GtkWindow" id="UpdateWindow"> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="title" translatable="yes">Updateble Packages</property> + <property name="title" translatable="yes">Updatable Packages</property> <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property> <property name="destroy_with_parent">True</property> <property name="urgency_hint">True</property> diff --git a/portato/gui/utils.py b/portato/gui/utils.py index 59210e1..0a2930b 100644 --- a/portato/gui/utils.py +++ b/portato/gui/utils.py @@ -204,7 +204,7 @@ class Database (object): else: ninst = [] for pkg in self._db[cat]: - if pkg[2]: + if pkg.inst: yield pkg else: ninst.append(pkg) diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index 2c9eade..36054a1 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -25,7 +25,7 @@ from ...backend import flags, system # must be the first to avoid circular deps from ... import get_listener, plugin, dependency from ...helper import debug, warning, error, info, unique_array from ...session import Session -from ...constants import CONFIG_LOCATION, VERSION, APP_ICON +from ...constants import CONFIG_LOCATION, VERSION, APP_ICON, ICON_DIR from ...backend.exceptions import PackageNotFoundException, BlockedException # more GUI stuff @@ -829,7 +829,7 @@ class MainWindow (Window): Builds the terminal. """ - self.console.set_scrollback_lines(1024) + self.console.set_scrollback_lines(2**20) self.console.set_scroll_on_output(True) self.console.set_font_from_string(self.cfg.get("consolefont", "GUI")) self.console.connect("button-press-event", self.cb_right_click) @@ -1599,8 +1599,10 @@ class MainWindow (Window): self.emergePaused = cb.get_active() if not self.emergePaused: self.queue.continue_emerge() + self.tray.set_from_file(APP_ICON) else: self.queue.stop_emerge() + self.tray.set_from_file(os.path.join(ICON_DIR, "pausing.png")) # block the handlers of the other buttons # so that calling "set_active" does not call this callback recursivly diff --git a/portato/plistener.py b/portato/plistener.py index 1a5197a..8d35ece 100644 --- a/portato/plistener.py +++ b/portato/plistener.py @@ -90,13 +90,7 @@ class PListener (object): self._sig = None self._rw = None else: - try: # local version - from _shm import shm_wrapper as shm - except ImportError: - try: # version installed together with portato - from portato._shm import shm_wrapper as shm - except ImportError: # the normal shm module - import shm_wrapper as shm + import shm_wrapper as shm self._mem = shm.SharedMemoryHandle(mem) self._sig = shm.SemaphoreHandle(sig) diff --git a/portato/plugins/dbus_init.py b/portato/plugins/dbus_init.py index 851562c..653af31 100644 --- a/portato/plugins/dbus_init.py +++ b/portato/plugins/dbus_init.py @@ -1,4 +1,10 @@ -from dbus.mainloop.glib import threads_init +try: + from dbus.mainloop.glib import threads_init +except ImportError: + threads_init = None + +from portato.constants import USE_CATAPULT def dbus_init (*args): - threads_init() + if USE_CATAPULT and threads_init is not None: + threads_init() |