OXIESEC PANEL
- Current Dir:
/
/
opt
/
gsutil
/
gslib
/
utils
/
__pycache__
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/11/2025 08:19:48 AM
rwxr-xr-x
📄
__init__.cpython-39.pyc
126 bytes
02/11/2025 08:19:48 AM
rw-r--r--
📄
acl_helper.cpython-39.pyc
9.38 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
arg_helper.cpython-39.pyc
1.01 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
boto_util.cpython-39.pyc
16.46 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
cat_helper.cpython-39.pyc
4.21 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cloud_api_helper.cpython-39.pyc
3.29 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
constants.cpython-39.pyc
2.88 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
copy_helper.cpython-39.pyc
101.64 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
encryption_helper.cpython-39.pyc
5.84 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
execution_util.cpython-39.pyc
1.06 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
hashing_helper.cpython-39.pyc
15.71 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
iam_helper.cpython-39.pyc
8.61 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
ls_helper.cpython-39.pyc
12.4 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
metadata_util.cpython-39.pyc
3.1 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
parallelism_framework_util.cpython-39.pyc
11.79 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
posix_util.cpython-39.pyc
12.46 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
retention_util.cpython-39.pyc
8.77 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
retry_util.cpython-39.pyc
2.5 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rsync_util.cpython-39.pyc
1.6 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
shim_util.cpython-39.pyc
19.8 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
signurl_helper.cpython-39.pyc
4.21 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
stet_util.cpython-39.pyc
3.35 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
system_util.cpython-39.pyc
7.9 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
temporary_file_util.cpython-39.pyc
915 bytes
02/11/2025 08:19:49 AM
rw-r--r--
📄
text_util.cpython-39.pyc
12.62 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
translation_helper.cpython-39.pyc
25.67 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
unit_util.cpython-39.pyc
7.01 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
update_util.cpython-39.pyc
3.39 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
user_agent_helper.cpython-39.pyc
1.49 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
version_check.cpython-39.pyc
1.39 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
wrapped_credentials.cpython-39.pyc
5.81 KB
02/11/2025 08:19:49 AM
rw-r--r--
Editing: text_util.cpython-39.pyc
Close
a +(Wg�3 � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlZddlZddlmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ejr�eZddddddd�Z edd� �Z!dd� Z"dd� Z#dd� Z$dd� Z%dd� Z&d d!� Z'd"d#� Z(d$d%� Z)d&d'� Z*d(d)� Z+d*d+� Z,d,d-� Z-d.d/� Z.d0d1� Z/d2d3� Z0d4d5� Z1d8d6d7�Z2dS )9z<Shared utility structures and methods for manipulating text.� )�absolute_import)�print_function)�division)�unicode_literalsN)�urllib)�range��CommandException)�LazyWrapper)�UTF8)�WINDOWS_1252)� IS_CP1252ZCOLDLINEZDURABLE_REDUCED_AVAILABILITYZNEARLINEZSTANDARDZARCHIVE)ZCLZDRA�NL�SZSTD�Ac C s t �d�S )Nz,^(?P<maj>\d+)(\.(?P<min>\d+)(?P<suffix>.*))?)�re�compile� r r �$/opt/gsutil/gslib/utils/text_util.py�<lambda>8 � r c C sb t j�| �\}}}}}t jj|dd�}|�||f� d�dd� |D ��} t j�|||| |f�} | S )a� Adds a query parameter to a URL string. Appends a query parameter to the query string portion of a url. If a parameter with the given name was already present, it is not removed; the new name/value pair will be appended to the end of the query string. It is assumed that all arguments will be of type `str` (either ASCII or UTF-8 encoded) or `unicode`. Note that this method performs no URL-encoding. It is the caller's responsibility to ensure proper URL encoding of the entire URL; i.e. if the URL is already URL-encoded, you should pass in URL-encoded values for param_name and param_value. If the URL is not URL-encoded, you should not pass in URL-encoded parameters; instead, you could perform URL-encoding using the URL string returned from this function. Args: url_str: (str or unicode) String representing the URL. param_name: (str or unicode) String key of the query parameter. param_value: (str or unicode) String value of the query parameter. Returns: (str or unicode) A string representing the modified url, of type `unicode` if the url_str argument was a `unicode`, otherwise a `str` encoded in UTF-8. T)�keep_blank_values�&c S s g | ]\}}d ||f �qS )z%s=%sr )�.0�k�vr r r � <listcomp>W r z&AddQueryParamToUrl.<locals>.<listcomp>)r �parse�urlsplit� parse_qsl�append�join� urlunsplit)�url_strZ param_nameZparam_value�scheme�netloc�pathZ query_str�fragmentZquery_paramsZ new_query_strZnew_urlr r r �AddQueryParamToUrl; s �r( c C s� t � �t| ��}t � �t|��}|r(|s,dS t|�d��}|�d�rRt|�d��nd}|�d�}t|�d��}|�d�r�t|�d��nd}|�d�} ||kr�dS ||kr�||kr�dS ||kr�t| �o�| dfS dS ) al Compares the first and second gsutil version strings. For example, 3.33 > 3.7, and 4.1 is a greater major version than 3.33. Does not handle multiple periods (e.g. 3.3.4) or complicated suffixes (e.g., 3.3RC4 vs. 3.3RC5). A version string with a suffix is treated as less than its non-suffix counterpart (e.g. 3.32 > 3.32pre). Args: first: First gsutil version string. second: Second gsutil version string. Returns: (g, m): g is True if first known to be greater than second, else False. m is True if first known to be greater by at least 1 major version, else False. )FFZmaj�minr �suffix)TT)TFF)�VERSION_MATCHER�match�str�int�group�bool) �first�secondZm1Zm2Z major_ver1Z minor_ver1Zsuffix_ver1Z major_ver2Z minor_ver2Zsuffix_ver2r r r �CompareVersions^ s$ r3 c c s | D ]}d| V qdS )z:A generator that adds '**' to each url string in url_strs.z%s**Nr )Zurl_strsr# r r r �ConvertRecursiveToFlatWildcard� s r4 c C s&