📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-21 14:30:27
📂
/ (Root)
/
usr
/
lib
/
python3.6
/
site-packages
/
netaddr
/
ip
/
__pycache__
📍 /usr/lib/python3.6/site-packages/netaddr/ip/__pycache__
🔄 Refresh
✏️
Editing: glob.cpython-36.pyc
Read Only
3 ��]�( � @ s| d Z ddlmZmZ ddlmZmZmZmZ ddl m Z dd� Zdd� Zd d � Z dd� Zd d� Zdd� ZG dd� de�ZdS )zb Routines and classes for supporting and expressing IP address ranges using a glob style syntax. � )�AddrFormatError�AddrConversionError)�IPRange� IPAddress� IPNetwork�iprange_to_cidrs)�_is_strc C s@ t | �sdS d}d}| jd�}t|�dkr.dS �x |D �] }d|kr�|rLdS d}|rXdS ydd� |jd�D �\}}W n tk r� dS X ||kr�dS d| ko�d kn s�dS d | ko�dkn s�dS q6|dkr�d}q6|dkr�dS |dk� r�dS y(dt|� k�odkn �sdS W q6 tk �r6 dS X q6W dS ) z� :param ipglob: An IP address range in a glob-style format. :return: ``True`` if IP range glob is valid, ``False`` otherwise. F�.� �-Tc S s g | ]}t |��qS � )�int)�.0�ir r �/usr/lib/python3.6/glob.py� <listcomp>. s zvalid_glob.<locals>.<listcomp>r � � � �*)r �split�len� ValueErrorr )�ipglob�seen_hyphen� seen_asteriskZoctets�octetZoctet1Zoctet2r r r � valid_glob sH r c C s� t | �std| ��g }g }xt| jd�D ]f}d|kr\|jd�}|j|d � |j|d � q(|dkrz|jd� |jd� q(|j|� |j|� q(W tdj|��tdj|��fS ) z� A function that accepts a glob-style IP range and returns the component lower and upper bound IP address. :param ipglob: an IP address range in a glob-style format. :return: a tuple contain lower and upper bound IP objects. z#not a recognised IP glob range: %r!r r r r r �0�255)r r r �appendr �join)r �start_tokens� end_tokensr �tokensr r r �glob_to_iptupleF s r% c C s� t | �std| ��g }g }xt| jd�D ]f}d|kr\|jd�}|j|d � |j|d � q(|dkrz|jd� |jd� q(|j|� |j|� q(W tdj|�dj|��S ) z� A function that accepts a glob-style IP range and returns the equivalent IP range. :param ipglob: an IP address range in a glob-style format. :return: an IPRange object. z#not a recognised IP glob range: %r!r r r r r r r )r r r r r r! )r r"