Пример #1
0
    def launch(self, pkg: SnapApplication):
        commands = SnapdClient(self.logger).list_commands(pkg.name)

        if commands:
            if len(commands) == 1:
                cmd = commands[0]['name']
            else:
                desktop_cmd = [c for c in commands if 'desktop-file' in c]

                if desktop_cmd:
                    cmd = desktop_cmd[0]['name']
                else:
                    cmd = commands[0]['name']

            self.logger.info("Running '{}': {}".format(pkg.name, cmd))
            snap.run(cmd)
Пример #2
0
 def launch(self, pkg: SnapApplication):
     snap.run(pkg, self.context.logger)