ok
Direktori : /opt/alt/python38/lib64/python3.8/site-packages/maxminddb/__pycache__/ |
Current File : //opt/alt/python38/lib64/python3.8/site-packages/maxminddb/__pycache__/decoder.cpython-38.pyc |
U ��^� � @ sL d Z ddlmZ ddlZddlmZmZmZ ddlm Z G dd� de �ZdS )zl maxminddb.decoder ~~~~~~~~~~~~~~~~~ This package contains code for decoding the MaxMind DB data section. � )�unicode_literalsN)� byte_from_int� int_from_byte�int_from_bytes��InvalidDatabaseErrorc @ s� e Zd ZdZd$dd�Zdd� Zdd � Zd d� Zdd � Zdd� Z dd� Z dd� Zdd� Zdd� Z dd� Zeeeee e ee e e eee d� Zdd� Zdd� Zdd � Zd!d"� Zd#S )%�Decoderz.Decoder for the data section of the MaxMind DBr Fc C s || _ || _|| _dS )a Created a Decoder for a MaxMind DB Arguments: database_buffer -- an mmap'd MaxMind DB file. pointer_base -- the base number to use when decoding a pointer pointer_test -- used for internal unit testing of pointer code N)� _pointer_test�_buffer� _pointer_base)�selfZdatabase_bufferZpointer_baseZpointer_test� r �/decoder.py�__init__ s zDecoder.__init__c C s2 g }t |�D ]}| �|�\}}|�|� q||fS �N)�range�decode�append)r �size�offsetZarray�_�valuer r r � _decode_array s zDecoder._decode_arrayc C s |dk|fS )Nr r )r r r r r r �_decode_boolean&