def activate_multiple(self, objects, ctx): appmap = {} leafmap = {} for obj in objects: app = self.default_application_for_leaf(obj) id_ = app.get_id() appmap[id_] = app leafmap.setdefault(id_, []).append(obj) for id_, leaves in leafmap.items(): app = appmap[id_] launch.launch_application(app, paths=[L.object for L in leaves], activate=False, screen=ctx and ctx.environment.get_screen())
def launch_app(app_info, files=(), uris=(), paths=()): " Raises SpawnError " # With files we should use activate=False return launch.launch_application(app_info, files, uris, paths, activate=False)
def launch(self, files=(), paths=(), activate=False): """ Launch the represented applications @files: a seq of GFiles (gio.File) @paths: a seq of bytestring paths @activate: activate instead of start new """ try: return launch.launch_application(self.object, files=files, paths=paths, activate=activate, desktop_file=self.init_path) except launch.LaunchError as exc: raise OperationError(unicode(exc))
def launch(self, files=(), paths=(), activate=False, ctx=None): """ Launch the represented applications @files: a seq of GFiles (gio.File) @paths: a seq of bytestring paths @activate: activate instead of start new """ try: return launch.launch_application(self.object, files=files, paths=paths, activate=activate, desktop_file=self.init_path, screen=ctx and ctx.environment.get_screen()) except launch.SpawnError as exc: raise OperationError(exc)
def launch(self, files=(), paths=(), activate=False, ctx=None): """ Launch the represented applications @files: a seq of GFiles (Gio.File) @paths: a seq of bytestring paths @activate: activate instead of start new """ try: return launch.launch_application(self.object, files=files, paths=paths, activate=activate, desktop_file=self.init_path, screen=ctx and ctx.environment.get_screen()) except launch.SpawnError as exc: raise OperationError(exc)
def activate(self, leaf): desktop_item = leaf.object launch.launch_application(leaf.object, activate=not self.open_new)
def launch_app(app_info, files=(), uris=(), paths=()): from kupfer import launch # With files we should use activate=False return launch.launch_application(app_info, files, uris, paths, activate=False)
def launch_commandline(cli, name=None, in_terminal=False): from kupfer import launch app_info = app_info_for_commandline(cli, name, in_terminal) pretty.print_debug(__name__, "Launch commandline (in_terminal=", in_terminal, "):", cli, sep="") return launch.launch_application(app_info, activate=False, track=False)