def open_uri(uri): """Opens a local or remote URI with the default application""" system.reset_library_preloads() try: Gtk.show_uri(None, uri, Gdk.CURRENT_TIME) except GLib.Error as ex: logger.exception("Failed to open URI %s: %s", uri, ex)
def open_uri(uri): """Opens a local or remote URI with the default application""" system.reset_library_preloads() try: Gtk.show_uri(None, uri, Gdk.CURRENT_TIME) except GLib.Error as ex: logger.exception("Failed to open URI %s: %s", uri, ex)
def apply_environment(self): """Applies the environment variables to the system's environment.""" # Store provided environment variables so they can be used by future # processes. for key, value in self.env.items(): logger.debug('Storing environment variable %s to %s', key, value) self.original_env[key] = os.environ.get(key) os.environ[key] = value # Reset library paths if they were not provided if not any([key in self.env for key in ('LD_LIBRARY_PATH', 'LD_PRELOAD')]): system.reset_library_preloads() # Copy the resulting environment to what will be passed to the process env = os.environ.copy() env.update(self.env) return env
def open_uri(uri): """Opens a local or remote URI with the default application""" system.reset_library_preloads() Gtk.show_uri(None, uri, Gdk.CURRENT_TIME)