← Back
Editing: univ.cpython-38.pyc
U s�Z#� � @ sT d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dl mZ d dl mZ d d l m Z d d l mZ d dl mZ d dl mZ ejZe� Zd dddddddddddddddddgZG dd � d ej�ZG d d� de�Zejd d!k r�eZneZG d"d#� d#e�ZG d$d� dej�Zze W n ek �rJ d%d&� ZY nX G d'd� dej�ZG d(d� de�Z ejd d)k�r�eefZ!nefZ!e!e"f Z#G d*d� dej�Z$G d+d� dej�Z%G d,d� de�Z&G d-d� dej'�Z(G d.d� de(�Z)G d/d� de(�Z*G d0d� dej'�Z+G d1d� de+�Z,G d2d� de+�Z-G d3d� de-�Z.G d4d� de�Z/dS )5� N)�error)�eoo)�binary)�integer)�octets)�base)� constraint)� namedtype)�namedval)�tag)�tagmap�Integer�Boolean� BitString�OctetString�Null�ObjectIdentifier�Real� Enumerated�SequenceOfAndSetOfBase� SequenceOf�SetOf�SequenceAndSetBase�Sequence�Set�Choice�Any�NoValue�noValuec @ s e Zd ZdZe�e�ejejd��Z e �� Ze �� Zej�� Zefdd�Zdd� Zdd� Zd d � Zdd� Zd d� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Z dd� Z!dd� Z"dd � Z#d!d"� Z$d#d$� Z%dfd&d'�Z&d(d)� Z'd*d+� Z(d,d-� Z)e*j+d. dk�rd/d0� Z,d1d2� Z-n(d3d4� Z.d5d6� Z/d7d8� Z0d9d:� Z1ejj2Z2d;d<� Z3e*j+d. dk�rVd=d>� Z4d?d@� Z5dAdB� Z6dCdD� Z7dEdF� Z8dGdH� Z9dIdJ� Z:dgdKdL�Z;dMdN� Z<dOdP� Z=e*j+d.d� dQk�r�dRdS� Z>dTdU� Z?dVdW� Z@dXdY� ZAdZd[� ZBd\d]� ZCd^d_� ZDd`da� ZEdbdc� ZFddde� ZGd%S )hr a Create |ASN.1| type or object. |ASN.1| objects are immutable and duck-type Python :class:`int` objects. Keyword Args ------------ value: :class:`int`, :class:`str` or |ASN.1| object Python integer or string literal or |ASN.1| class instance. tagSet: :py:class:`~pyasn1.type.tag.TagSet` Object representing non-default ASN.1 tag(s) subtypeSpec: :py:class:`~pyasn1.type.constraint.ConstraintsIntersection` Object representing non-default ASN.1 subtype constraint(s) namedValues: :py:class:`~pyasn1.type.namedval.NamedValues` Object representing non-default symbolic aliases for numbers Raises ------ :py:class:`~pyasn1.error.PyAsn1Error` On constraint violation or bad initializer. Examples -------- .. code-block:: python class ErrorCode(Integer): ''' ASN.1 specification: ErrorCode ::= INTEGER { disk-full(1), no-disk(-1), disk-not-formatted(2) } error ErrorCode ::= disk-full ''' namedValues = NamedValues( ('disk-full', 1), ('no-disk', -1), ('disk-not-formatted', 2) ) error = ErrorCode('disk-full') � c K s( d|kr| j |d<