script_commands.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:taktyk 作者: kosior 项目源码 文件源码
def process_unimported(self):
        msg = 'Brak modu?u pip!\nNie mo?na zainstalowa?:\n%s'
        msg_dec = 'Wymagane modu?y:\n{}\nChcesz zainstalowa? (T/n)? '
        self.to_import = list(self.unimported)
        modules_text = '\n'.join([' {} - {}'.format(ins, ver) for _, ins, ver in self.unimported])
        if self.try_import('pip', add=False):
            msg_dec = msg_dec.format(modules_text)
            decision = Decision(msg_dec, {'T': {self.install_unimported: (self.unimported,)},
                                          'n': sys.exit})
            decision.run()
            if all(self.import_all(reload=True)):
                logging.info('...ponowne uruchamianie')
                os.execv(sys.executable, ['python'] + sys.argv)
            else:
                logging.critical('Nie uda?o si? zainstalowa? modu?ów.')
                raise SystemExit
        else:
            logging.critical(msg, modules_text)
            raise SystemExit
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号