def run_command_init(self): if os.path.exists(self._venv): logger.info('venv command is already initialized.') return if not os.access(PATH_DISTS, os.W_OK): logger.error("Can not initialize venv command: Permission denied.") sys.exit(1) d = Downloader() download_file = os.path.join(PATH_DISTS, 'virtualenv.tar.gz') d.download('virtualenv.tar.gz', VIRTUALENV_DLSITE, download_file) logger.info('Extracting virtualenv into %s' % self._venv_dir) untar_file(download_file, self._venv_dir)
def run_command_init(self): if os.path.exists(self._venv): logger.info('Remove virtualenv. (%s)' % self._venv_dir) rm_r(self._venv_dir) if os.path.exists(self._venv_clone): logger.info('Remove virtualenv-clone. (%s)' % self._venv_clone_dir) rm_r(self._venv_clone_dir) if not os.access(PATH_DISTS, os.W_OK): logger.error("Can not initialize venv command: Permission denied.") sys.exit(1) d = Downloader() download_file = os.path.join(PATH_DISTS, 'virtualenv.tar.gz') d.download('virtualenv.tar.gz', VIRTUALENV_DLSITE, download_file) logger.info('Extracting virtualenv into %s' % self._venv_dir) untar_file(download_file, self._venv_dir) download_file = os.path.join(PATH_DISTS, 'virtualenv-clone.tar.gz') d.download('virtualenv-clone.tar.gz', VIRTUALENV_CLONE_DLSITE, download_file) logger.info('Extracting virtualenv-clone into %s' % self._venv_clone_dir) untar_file(download_file, self._venv_clone_dir)