CURRENT PATH:
/
opt
/
gsutil
/
gslib
/
commands
/
__pycache__
/
[ ⬅ KEMBALI ]
|
[ HOME ]
Upload File:
Upload Ke Sini
Dir Baru
File Baru
Editing:
version.cpython-39.pyc
a +(Wgy � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ dZde d ZG dd� de�Zdd� ZdS )�)Implementation of gsutil version command.� )�absolute_import)�print_function)�division)�unicode_literalsN)�Command)�system_util)�GetFriendlyConfigFilePaths)�UsingCrcmodExtension)�UTF8)�GetMd5)�$CheckMultiprocessingAvailableAndInitz gsutil version z <B>SYNOPSIS</B> aS <B>DESCRIPTION</B> Prints information about the version of gsutil. <B>OPTIONS</B> -l Prints additional information, such as the version of Python being used, the version of the Boto library, a checksum of the code, the path to gsutil, and the path to gsutil's configuration file. c @ sV e Zd ZdZejddgeddddddd� Zejddgdd e i d �Z dd� Zd d� ZdS )�VersionCommandr �version�verr �lF)�command_name_aliases�usage_synopsis�min_args�max_args�supported_sub_args�file_url_ok�provider_url_ok�urls_start_arg�command_helpzPrint version info about gsutil)� help_name�help_name_aliases� help_type�help_one_line_summary� help_text�subcommand_help_textc C s d}| j r&| j D ]\}}|dkrd}qd�t� �}tj}z| �� }W n tyZ d}Y n0 ||krjd}nd| }tj� dtj � |r�d }tj� |j||tj tj�d d�dt�� t�� f t� jt�� t�� |t� p�tjt� tjtjtj�d dd�d�� dS )z,Command entry point for the version command.Fz-lTz, z MISSING FILES�OKz!= %szgsutil version: %s a� checksum: {checksum} ({checksum_ok}) boto version: {boto_version} python version: {python_version} OS: {os_version} multiprocessing available: {multiprocessing_available} using cloud sdk: {cloud_sdk} pass cloud sdk credentials to gsutil: {cloud_sdk_credentials} config path(s): {config_paths} gsutil path: {gsutil_path} compiled crcmod: {compiled_crcmod} installed via package manager: {is_package_install} editable install: {is_editable_install} shim enabled: {is_shim_enabled} � � z%s %s�GSUtil�use_gcloud_storage)�checksumZchecksum_ok�boto_version�python_version� os_versionZmultiprocessing_availableZ cloud_sdkZcloud_sdk_credentials�config_paths�gsutil_pathZcompiled_crcmodZis_package_installZis_editable_installZis_shim_enabledr )�sub_opts�joinr �gslib�CHECKSUM�_ComputeCodeChecksum�IOError�sys�stdout�write�VERSION�format�boto�__version__r �replace�platform�system�releaser �is_availabler �InvokedViaCloudSdk�CloudSdkCredPassingEnabled�"GetCloudSdkGsutilWrapperScriptPath�GSUTIL_PATHr �IS_PACKAGE_INSTALL�IS_EDITABLE_INSTALL�config�getbool) �selfZ long_form�o�_r* Zshipped_checksumZcur_checksumZchecksum_ok_strZlong_form_output� rI �%/opt/gsutil/gslib/commands/version.py� RunCommandT sP ����zVersionCommand.RunCommandc C s� t jr dS t� }t jg}t�t j�D ]2\}}}|D ]"}|�d�r2|�tj � ||�� q2q$t|�D ]z}tj r�t|d�}|�� }t�dd|�}|�|� |�� q`t|dtd�}|�� }t�dd|�}|�|�t�� |�� q`|�� S ) af Computes a checksum of gsutil code. This checksum can be used to determine if users locally modified gsutil when requesting support. (It's fine for users to make local mods, but when users ask for support we ask them to run a stock version of gsutil so we can reduce possible variables.) Returns: MD5 checksum of gsutil code. Z.PACKAGED_GSUTIL_INSTALLS_DO_NOT_HAVE_CHECKSUMSz.py�rbz(\r\n|\r|\n)� �r)�encodingr"