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, ctx): try: utils.spawn_terminal(leaf.object, ctx.environment.get_screen()) except utils.SpawnError as exc: raise OperationError(exc)