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
评论列表
文章目录