Exemplo n.º 1
0
 def _map_nativefier_file(self, nativefier_settings: dict) -> EnvironmentComponent:
     url = URL_NATIVEFIER.format(version=nativefier_settings['version'])
     return EnvironmentComponent(name='nativefier@{}'.format(nativefier_settings['version']),
                                 url=url,
                                 size=self.http_client.get_content_length(url),
                                 version=nativefier_settings['version'],
                                 id='nativefier')
Exemplo n.º 2
0
    def _install_nativefier(self, version: str, handler: ProcessHandler) -> bool:
        self.logger.info("Checking if nativefier@{} exists".format(version))

        url = URL_NATIVEFIER.format(version=version)
        if not self.http_client.exists(url):
            self.logger.warning("The file {} seems not to exist".format(url))
            handler.watcher.show_message(title=self.i18n['message.file.not_exist'],
                                         body=self.i18n['message.file.not_exist.body'].format(bold(url)),
                                         type_=MessageType.ERROR)
            return False

        success = self._install_node_lib('nativefier', version, handler)

        if success:
            return self._is_nativefier_installed()