ó
e#ñ]c           @   s  d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m	 Z	 m
 Z
 e j e ƒ Z d e j f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e e f d „  ƒ  YZ d e e f d „  ƒ  YZ d e e f d „  ƒ  YZ d d l Z d e	 j f d „  ƒ  YZ d e e f d „  ƒ  YZ e
 j d e f d „  ƒ  Yƒ Z d e e e f d „  ƒ  YZ d e j f d  „  ƒ  YZ d! e j  e f d" „  ƒ  YZ! e d# e! ƒ e! _" e! j" j# d$ e
 j$ d% ƒ d& d% ƒ e! _% e! j" j# d$ e
 j$ d' ƒ d& d' ƒ e! _& e! j" j# d$ e
 j$ d( ƒ d& d( ƒ e! _' e! j( e! j" ƒ d) e e f d* „  ƒ  YZ) d+ e e e f d, „  ƒ  YZ* d- e e e f d. „  ƒ  YZ+ d/ e e e f d0 „  ƒ  YZ, d1 e e e f d2 „  ƒ  YZ- d3 e e f d4 „  ƒ  YZ. d5 e e f d6 „  ƒ  YZ/ d7 e f d8 „  ƒ  YZ0 d9 e0 f d: „  ƒ  YZ1 d; e0 f d< „  ƒ  YZ2 d= e0 f d> „  ƒ  YZ3 d? e0 f d@ „  ƒ  YZ4 dA e0 f dB „  ƒ  YZ5 e e e e e e) e* e+ e, e- e. e/ g e _6 e1 e2 e3 e4 e5 g e0 _6 g  e _6 e j6 j7 e j6 ƒ e j6 j7 e0 j6 ƒ e ƒ  e j8 _9 e ƒ  e j8 _: e d# e j8 ƒ e j8 _" e dC e j; d ƒ ƒ e j8 _< e) ƒ  e j8 _= e ƒ  e j8 _> e j8 j( e j8 j9 e j8 j: e j8 j" e j8 j< e j8 j= e j8 j> ƒ e j? j( ƒ  e j@ j( ƒ  e jA j( ƒ  e ƒ  e jB _9 e ƒ  e jB _: e d# e jB ƒ e jB _" e dC e j; d ƒ ƒ e jB _< e) ƒ  e jB _= e ƒ  e jB _> e jB j( e jB j9 e jB j: e jB j" e jB j< e jB j= e jB j> ƒ e ƒ  e jC _9 e jC j9 jD dD e
 j$ dE ƒ ƒ e jC j( e jC j9 ƒ e ƒ  e j  _9 e j  j9 jD dD e
 j$ dF ƒ ƒ e j  j( e j  j9 ƒ e ƒ  e jE _9 e ƒ  e jE _: e d# e jE ƒ e jE _" e dC e j; d ƒ ƒ e jE _< e) ƒ  e jE _= e ƒ  e jE _> e jE j( e jE j9 e jE j: e jE j" e jE j< e jE j= e jE j> ƒ e ƒ  e jF _< e ƒ  e jF _: e d# e jF ƒ e jF _" e ƒ  e jF _9 e) dC e! j' ƒ e jF _= e ƒ  e jF _> e jF j( e jF j< e jF j: e jF j" e jF j9 e jF j= e jF j> ƒ e ƒ  e jG _9 e jG j9 jD dD e
 j$ dG ƒ ƒ e jG j( e jG j9 ƒ e ƒ  e jH _< e ƒ  e jH _: e d# e jH ƒ e jH _" e ƒ  e jH _9 e) dC e! j' ƒ e jH _= e ƒ  e jH _> e jH j( e jH j< e jH j: e jH j" e jH j9 e jH j= e jH j> ƒ e ƒ  e jI _< e ƒ  e jI _: e d# e jI ƒ e jI _" e ƒ  e jI _9 e) dC e! j' ƒ e jI _= e ƒ  e jI _> e jI j( e jI j< e jI j: e jI j" e jI j9 e jI j= e jI j> ƒ e ƒ  e jJ _< e ƒ  e jJ _: e d# e jJ ƒ e jJ _" e ƒ  e jJ _9 e) dC e! j' ƒ e jJ _= e ƒ  e jJ _> e jJ j( e jJ j< e jJ j: e jJ j" e jJ j9 e jJ j= e jJ j> ƒ e) dC e! j' ƒ e jK _= e ƒ  e jK _9 e jK j( e jK j= e jK j9 ƒ e* d# e jL dC e jM e
 j$ dH ƒ ƒ ƒ e jL _N e+ d# e jL dC e jM e
 j$ dI ƒ ƒ ƒ e jL _O e jL j( e jL jN e jL jO ƒ e ƒ  e jP _9 e* d# e jP ƒ e jP _N e- d# e jM ƒ e jP _Q e, d# e jM ƒ e jP _R e d# e jP ƒ e jP _" e) dC e! j' ƒ e jP _= e+ d# e jP ƒ e jP _O e jP j( e jP j9 e jP jN e jP jQ e jP jR e jP j" e jP j= e jP jO ƒ e ƒ  e jS _9 e* d# e jS ƒ e jS _N e- d# e jM ƒ e jS _Q e, d# e jM ƒ e jS _R e d# e jS ƒ e jS _" e) dC e! j' ƒ e jS _= e+ d# e jS ƒ e jS _O e jS j( e jS j9 e jS jN e jS jQ e jS jR e jS j" e jS j= e jS jO ƒ e. ƒ  e j _T e ƒ  e j _9 e* d# e j ƒ e j _N e- d# e jM ƒ e j _Q e, d# e jM ƒ e j _R e d# e j ƒ e j _" e) dC e! j' ƒ e j _= e/ ƒ  e j _U e+ d# e j ƒ e j _O e j j( e j jT e j j9 e j jN e j jQ e j jR e j j" e j j= e j jU e j jO ƒ	 e ƒ  e jV _9 e* d# e jV ƒ e jV _N e- d# e jM ƒ e jV _Q e, d# e jM ƒ e jV _R e d# e jV ƒ e jV _" e) dC e! j' ƒ e jV _= e+ d# e jV ƒ e jV _O e jV j( e jV j9 e jV jN e jV jQ e jV jR e jV j" e jV j= e jV jO ƒ e ƒ  e jW _9 e* d# e jW ƒ e jW _N e- d# e jM ƒ e jW _Q e, d# e jM ƒ e jW _R e d# e jW ƒ e jW _" e) dC e! j' ƒ e jW _= e+ d# e jW ƒ e jW _O e jW j( e jW j9 e jW jN e jW jQ e jW jR e jW j" e jW j= e jW jO ƒ e ƒ  e jX _9 e* d# e jX ƒ e jX _N e- d# e jM ƒ e jX _Q e, d# e jM ƒ e jX _R e d# e jX ƒ e jX _" e) dC e! j' ƒ e jX _= e+ d# e jX ƒ e jX _O e jX j( e jX j9 e jX jN e jX jQ e jX jR e jX j" e jX j= e jX jO ƒ e ƒ  e jY _9 e* d# e jY ƒ e jY _N e- d# e jM ƒ e jY _Q e, d# e jM ƒ e jY _R e d# e jY ƒ e jY _" e) dC e! j' ƒ e jY _= e+ d# e jY ƒ e jY _O e jY j( e jY j9 e jY jN e jY jQ e jY jR e jY j" e jY j= e jY jO ƒ e ƒ  e jZ _9 e* d# e jZ ƒ e jZ _N e- d# e jM ƒ e jZ _Q e, d# e jM ƒ e jZ _R e d# e jZ ƒ e jZ _" e) dC e! j' ƒ e jZ _= e+ d# e jZ ƒ e jZ _O e jZ j( e jZ j9 e jZ jN e jZ jQ e jZ jR e jZ j" e jZ j= e jZ jO ƒ e ƒ  e j[ _9 e* d# e j[ ƒ e j[ _N e- d# e jM ƒ e j[ _Q e, d# e jM ƒ e j[ _R e d# e j[ ƒ e j[ _" e) dC e! j' ƒ e j[ _= e+ d# e j[ ƒ e j[ _O e j[ j( e j[ j9 e j[ jN e j[ jQ e j[ jR e j[ j" e j[ j= e j[ jO ƒ e ƒ  e j\ _9 e* d# e j\ ƒ e j\ _N e- d# e jM ƒ e j\ _Q e, d# e jM ƒ e j\ _R e d# e j\ ƒ e j\ _" e) dC e! j' ƒ e j\ _= e+ d# e j\ ƒ e j\ _O e j\ j( e j\ j9 e j\ jN e j\ jQ e j\ jR e j\ j" e j\ j= e j\ jO ƒ e ƒ  e j] _9 e* d# e j] ƒ e j] _N e- d# e jM ƒ e j] _Q e, d# e jM ƒ e j] _R e d# e j] ƒ e j] _" e) dC e! j' ƒ e j] _= e+ d# e j] ƒ e j] _O e j] j( e j] j9 e j] jN e j] jQ e j] jR e j] j" e j] j= e j] jO ƒ e ƒ  e j^ _< e ƒ  e j^ _: e d# e j^ ƒ e j^ _" e ƒ  e j^ _9 e) dC e! j' ƒ e j^ _= e ƒ  e j^ _> e j^ j( e j^ j< e j^ j: e j^ j" e j^ j9 e j^ j= e j^ j> ƒ e* d# e j_ dC e jM e
 j$ dJ ƒ ƒ ƒ e j_ _N e+ d# e j_ dC e jM e
 j$ dK ƒ ƒ ƒ e j_ _O e j_ j( e j_ jN e j_ jO ƒ e ƒ  e j` _9 e j` j9 jD dD e
 j$ dL ƒ ƒ e/ dC e j; dM ƒ ƒ e j` _U e j` j( e j` j9 e j` jU ƒ e ƒ  e ja _9 e ja j9 jD dD e
 j$ dN ƒ ƒ e ja j( e ja j9 ƒ e* d# e jb dC e jM e
 j$ dO ƒ ƒ ƒ e jb _N e+ d# e jb dC e jM e
 j$ dP ƒ ƒ ƒ e jb _O e jb j( e jb jN e jb jO ƒ e+ d# e jc dC e jM e
 j$ dQ ƒ ƒ ƒ e jc _O e jc j( e jc jO ƒ e* d# e j; dC e jM e
 j$ dR ƒ ƒ ƒ e j; _N e j; j( e j; jN ƒ e+ d# e jd dC e jM e
 j$ dR ƒ ƒ ƒ e jd _O e jd j( e jd jO ƒ e) dC e! j& ƒ e je _= e je j( e je j= ƒ e* d# e jf dC e jM e
 j$ dS ƒ ƒ ƒ e jf _N e jf j( e jf jN ƒ e* d# e jg dC e jM e
 j$ dT ƒ ƒ ƒ e jg _N e+ d# e jg dC e jM e
 j$ dU ƒ ƒ ƒ e jg _O e jg j( e jg jN e jg jO ƒ e ƒ  e jh _< e ƒ  e jh _: e d# e jh ƒ e jh _" e ƒ  e jh _9 e) dC e! j% ƒ e jh _= e ƒ  e jh _> e jh j( e jh j< e jh j: e jh j" e jh j9 e jh j= e jh j> ƒ e ƒ  e ji _9 e* d# e ji ƒ e ji _N e- d# e jM ƒ e ji _Q e, d# e jM ƒ e ji _R e d# e ji ƒ e ji _" e) dC e! j' ƒ e ji _= e+ d# e ji ƒ e ji _O e ji j( e ji j9 e ji jN e ji jQ e ji jR e ji j" e ji j= e ji jO ƒ e) dC e! j' ƒ e jj _= e jj j( e jj j= ƒ e+ d# e jk dC e jM e
 j$ dV ƒ ƒ ƒ e jk _O e jk j( e jk jO ƒ e+ d# e jl dC e jM e
 j$ dW ƒ ƒ ƒ e jl _O e jl j( e jl jO ƒ e+ d# e jm dC e jM e
 j$ dX ƒ ƒ ƒ e jm _O e jm j( e jm jO ƒ e+ d# e jn dC e jM e
 j$ dY ƒ ƒ ƒ e jn _O e jn j( e jn jO ƒ d S(Z   sh  Classes related to XMLSchema facets.

The definitions herein are from sections U{4.2<http://www.w3.org/TR/xmlschema-2/index.html#rf-facets>}
and U{4.3<http://www.w3.org/TR/xmlschema-2/index.html#rf-facets>} of
U{XML Schema Part 2: Datatypes<http://www.w3.org/TR/xmlschema-2/>}.
Facets are attributes of a datatype that constrain its lexical and
value spaces.

iÿÿÿÿNi   (   t	   datatypes(   t   basis(   t   utilityt   sixt   Facetc           B   s¹   e  Z d  Z d Z e d „  ƒ Z d Z d „  Z d Z	 d „  Z
 d Z d Z d „  Z d Z d „  Z d „  Z d Z d „  Z d „  Z d	 „  Z d
 „  Z e d „  ƒ Z d „  Z d „  Z RS(   sl   The base class for facets.

    This provides association with STDs, a name, and a value for the facet.
    c         C   s   |  j  S(   s(   The name of a facet is a class constant.(   t   _Name(   t   self(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   Name+   s    c         C   s   |  j  S(   s(  The SimpleTypeDefinition component restricted by this facet.

        Note: this is NOT the STD to which the facet belongs, but is
        usually that STD's base type.  I.e., this jumps us through all
        the containing restrictions and extensions to get to the core
        type definition.(   t   _Facet__baseTypeDefinition(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   baseTypeDefinition1   s    c         C   s   |  j  S(   sÔ   The SimpleTypeDefinition component to which this facet belongs.

        I.e., the one in which the hasFacet specification was found.
        This value is None if the facet is not associated with an
        STD.(   t   _Facet__ownerTypeDefinition(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   ownerTypeDefinition;   s    c         C   s>   |  j  d k r7 |  j ƒ  d k	 s' t ‚ |  j ƒ  j ƒ  S|  j  S(   s   Get the datatype used to represent values of the facet.

        This usually has nothing to do with the owner datatype; for
        example, the length facet may apply to any STD but the value
        of the facet is an integer.  In generated bindings this is
        usually set explicitly in the facet constructor; when
        processing a schema, it is derived from the value's type
        definition.
        N(   t   _Facet__valueDatatypet   NoneR	   t   AssertionErrort   pythonSupport(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   valueDatatypeJ   s    
c         C   s   | |  _  d  S(   N(   t   _Facet__value(   R   t   v(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   _valueZ   s    c         C   s   |  j  S(   N(   R   (   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   value[   s    c         C   s   |  j  S(   N(   t   _Facet__annotation(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt
   annotation^   s    c         K   sH   t  t |  ƒ j |   t |  j k s+ t ‚ |  j d t d t |  d S(   sE   Create a facet instance, initializing it from the keyword parameters.t   _resett   _constructorN(   t   superR   t   __init__t	   __class__R   t   setFromKeywordst   True(   R   t   kw(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   `   s    c            sÜ   | j  d t ƒ sN | j d ˆ  j ƒ | j d ˆ  j ƒ | j d ˆ  j ƒ n  | j  d ƒ ˆ  _ | j  d ƒ ˆ  _ | j  d ˆ  j ƒ ˆ  _ ˆ  j d k	 s® ˆ  j d k	 s® t ‚ t	 t
 t ˆ  ƒ d ‡  f d †  ƒ } | |   S(   s<  Configure values of the facet from a set of keywords.

        This method is pre-extended; subclasses should invoke the
        parent method after setting their local configuration.

        @keyword _reset: If C{False} or missing, existing values will
                         be retained if they do not appear in the
                         keywords.  If C{True}, members not defined in
                         the keywords are set to a default.
        @keyword base_type_definition:
        @keyword owner_type_definition:
        @keyword value_datatype:
        R   t   base_type_definitiont   owner_type_definitiont   value_datatypet   _setFromKeywords_vbc             s   ˆ  S(   N(    (   t   aR   (   R   (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   <lambda>   s    N(   t   gett   Falset
   setdefaultR   R
   R   t   _ValueDatatypeR   R   t   getattrR   R   (   R   R   t   super_fn(    (   R   sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR"   g   s    $$c         K   s   |  j  |   S(   s<   Public entrypoint to the _setFromKeywords_vb call hierarchy.(   R"   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   „   s    c         C   s¿   |  t  k s t ‚ d | j d ƒ k r@ | j d d ƒ d } n  t ƒ  j d |  j | f ƒ } | d k r© t j	 d | d j
 g  |  j D] } | j ^ q‡ ƒ f ƒ ‚ n  | d k	 s» t ‚ | S(   sH   Given the name of a facet, return the Facet subclass that represents it.i    t   :i   s   %s_%ss%   Unrecognized facet name %s: expect %st   ,N(   R   R   t   findt   splitt   globalsR%   t   _FacetPrefixR   t   pyxbt
   LogicErrort   joint   FacetsR   (   t   clst   namet   facet_classt   _f(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   ClassForFacetˆ   s    >c         C   sÎ   t  |  t ƒ rJ t j d ƒ j g  t j |  ƒ D] } t j | ƒ ^ q. ƒ S|  j ƒ  d  k	 r» |  j	 ƒ  d  k	 r» y |  j ƒ  j
 |  j	 ƒ  ƒ SWq» t k
 r· t j d |  j ƒ  ƒ ‚  q» Xn  t j |  j	 ƒ  ƒ S(   NR,   s%   Stringize facet %s produced exception(   t
   isinstancet   _CollectionFacet_mixinR   t   uR3   t	   iteritemst	   text_typeR   R   R   t
   XsdLiteralt	   Exceptiont   _logt	   exceptionR   (   R   t   _i(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   _valueString”   s    ;$
c         C   sa   g  } | j  d |  j ƒ  |  j ƒ  f ƒ t |  t ƒ rT |  j ƒ  rT | j  d ƒ n  d j | ƒ S(   Ns   %s="%s"s   [fixed]t    (   t   appendR   RD   R:   t   _Fixed_mixint   fixedR3   (   R   t   rv(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   __str__Ÿ   s
    #N(   t   __name__t
   __module__t   __doc__R   R   t   classmethodR   R   R	   R
   R   R(   R   R   R   R   R   R   R   R   R"   R   R9   RD   RJ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   $   s*   											t   ConstrainingFacetc           B   sA   e  Z d  Z d Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   sr   One of the facets defined in section 4.3, which provide
    constraints on the lexical space of a type definition.t   CFc         K   s   t  t |  ƒ j |   d  S(   N(   R   RO   R   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   °   s    c         C   s    t  j d |  j ƒ  f ƒ ‚ d  S(   Ns'   Facet %s does not implement constraints(   R1   R2   R   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   _validateConstraint_vx³   s    c         C   s   |  j  | ƒ S(   s•   Return True iff the given value satisfies the constraint represented by this facet instance.

        The actual test is delegated to the subclasses.(   RQ   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   validateConstraint¶   s    c         K   sY   | j  d ƒ } | d  k	 rU |  j ƒ  } t | | ƒ sE | | ƒ } n  |  j | ƒ n  d  S(   NR   (   R%   R   R   R:   R   (   R   R   t   kwvt   vdt(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   __setFromKeywords¼   s    c            sA   t  t t ˆ  ƒ d ‡  f d †  ƒ } | |   } ˆ  j |   | S(   sI   Extend base class.

        Additional keywords:
        * value
        R"   c             s   ˆ  S(   N(    (   R#   R   (   R   (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR$   Ë   s    (   R)   R   RO   t#   _ConstrainingFacet__setFromKeywords(   R   R   R*   RI   (    (   R   sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR"   Ä   s    $(	   RK   RL   RM   R0   R   RQ   RR   RV   R"   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRO   ¦   s   				t   _LateDatatype_mixinc           B   s;   e  Z d  Z d Z e d „  ƒ Z e d „  ƒ Z d „  Z RS(   s»  Marker class to indicate that the facet instance must be told
    its datatype when it is constructed.

    This is necessary for facets like L{CF_minInclusive} and
    L{CF_minExclusive}, for which the value is determined by the base
    type definition of the associated STD.  In some cases the value
    that must be used in the facet cannot be represented in the Python
    type used for the facet; see L{LateDatatypeBindsSuperclass}.
    c         C   s(   |  j  d k r! t j d ƒ ‚ n  |  j  S(   sš   Return true if false if the proposed datatype should be
        used, or True if the base type definition of the proposed
        datatype should be used.s;   Class %s did not set _LateDatatypeBindsSuperclass variable.N(   t   _LateDatatypeBindsSuperclassR   R1   R2   (   R5   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   LateDatatypeBindsSuperclassã   s    c         C   s‰   d d l  j j } t | | j ƒ rR x | j ƒ  sB | j ƒ  } q' W| j ƒ  } n  t | t	 j
 ƒ sj t ‚ |  j ƒ  r… | j ƒ  } n  | S(   s  Find the datatype for facet values when this facet is bound
        to the given value_type.

        If the C{value_type} is an STD, the associated Python support
        datatype from this value_type scanning up through the base
        type hierarchy is used.
        iÿÿÿÿN(   t   pyxb.xmlschema.structurest	   xmlschemat
   structuresR:   t   SimpleTypeDefinitiont   hasPythonSupportR	   R   t
   issubclassR   t   simpleTypeDefinitionR   RY   t   XsdSuperType(   R5   t
   value_typeR\   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   BindingValueDatatypeì   s    
c         C   s#   |  j  d t d |  j | ƒ ƒ d  S(   NR   R!   (   R   R   Rc   (   R   R!   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   bindValueDatatype  s    N(	   RK   RL   RM   R   RX   RN   RY   Rc   Rd   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRW   Ð   s
   		RG   c           B   s/   e  Z d  Z d Z d „  Z d „  Z d „  Z RS(   sJ   Mix-in to a constraining facet that adds support for the 'fixed' property.c         C   s   |  j  S(   N(   t   _Fixed_mixin__fixed(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRH     s    c         K   sR   | j  d t ƒ r d  |  _ n  | j  d ƒ } | d  k	 rN t j | ƒ |  _ n  d  S(   NR   RH   (   R%   R&   R   Re   R    t   boolean(   R   R   RS   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRU   
  s
    c            s;   ˆ  j  |   t t t ˆ  ƒ d ‡  f d †  ƒ } | |   S(   sI   Extend base class.

        Additional keywords:
        * fixed
        R"   c             s   ˆ  S(   N(    (   R#   R   (   R   (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR$     s    (   t   _Fixed_mixin__setFromKeywordsR)   R   RG   (   R   R   R*   (    (   R   sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR"     s    $N(   RK   RL   RM   R   Re   RH   Rg   R"   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRG     s
   		R;   c           B   s8   e  Z d  Z d Z d „  Z d „  Z d „  Z d „  Z RS(   s€  Mix-in to handle facets whose values are collections, not scalars.

    For example, the enumeration and pattern facets maintain a list of
    enumeration values and patterns, respectively, as their value
    space.

    Subclasses must define a class variable _CollectionFacet_itemType
    which is a reference to a class that is used to construct members
    of the collection.
    c            s€   | j  d t ƒ r g  ˆ  _ n  | j  d t ƒ sR ˆ  j j ˆ  j d ˆ  |  ƒ n  t t t ˆ  ƒ d ‡  f d †  ƒ } | |   S(   s  Extend base class.

        @keyword _constructor: If C{False} or absent, the object being
                               set is a member of the collection.  If
                               C{True}, the object being set is the
                               collection itself.
        R   R   t   facet_instanceR"   c             s   ˆ  S(   N(    (   R#   R   (   R   (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR$   4  s    (   R%   R&   t   _CollectionFacet_mixin__itemsRF   t   _CollectionFacet_itemTypeR)   R   R;   (   R   R   R*   (    (   R   sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR"   (  s    "$c         C   s   |  j  S(   s.   The members of the collection, as a reference.(   Ri   (   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   _items7  s    c         C   s   |  j  S(   s)   The members of the collection, as a copy.(   Ri   (   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   items;  s    c         C   s   t  |  j ƒ S(   s,   The members of the collection as an iterator(   t   iterRi   (   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR=   ?  s    N(	   RK   RL   RM   R   Ri   R"   Rk   Rl   R=   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR;     s   
			t	   CF_lengthc           B   s&   e  Z d  Z d Z e j Z d „  Z RS(   sˆ   A facet that specifies the length of the lexical representation of a value.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-length}
    t   lengthc         C   s:   | j  ƒ  } | d  k p9 |  j ƒ  d  k p9 | |  j ƒ  k S(   N(   t   xsdValueLengthR   R   (   R   R   t   value_length(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   K  s    (   RK   RL   RM   R   R    t   nonNegativeIntegerR(   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRn   C  s   	t   CF_minLengthc           B   s&   e  Z d  Z d Z e j Z d „  Z RS(   sŒ   A facet that constrains the length of the lexical representation of a value.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-minLength}
    t	   minLengthc         C   s:   | j  ƒ  } | d  k p9 |  j ƒ  d  k p9 | |  j ƒ  k S(   N(   Rp   R   R   (   R   R   Rq   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   W  s    (   RK   RL   RM   R   R    Rr   R(   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRs   O  s   	t   CF_maxLengthc           B   s&   e  Z d  Z d Z e j Z d „  Z RS(   sŒ   A facet that constrains the length of the lexical representation of a value.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-minLength}
    t	   maxLengthc         C   s:   | j  ƒ  } | d  k p9 |  j ƒ  d  k p9 | |  j ƒ  k S(   N(   Rp   R   R   (   R   R   Rq   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   c  s    (   RK   RL   RM   R   R    Rr   R(   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRu   [  s   	t   _PatternElementc           B   s`   e  Z d  Z e ƒ  Z d Z e j d ƒ d Z d Z	 d Z
 d d d d „ Z d „  Z d „  Z RS(   sU   This class represents individual patterns that appear within a CF_pattern collection.t   compiledExpressionc         K   s•   | d  k r' | d  k	 s t ‚ | } n  t | t j ƒ s? t ‚ | |  _ t | t j ƒ rf | |  _ n  t j j	 j
 | ƒ |  _ t t |  ƒ j ƒ  d  S(   N(   R   R   R:   R   t   string_typest   patternR   R1   t   utilst   xmlret   XMLToPythont!   _PatternElement__pythonExpressionR   Rw   R   (   R   Rz   R   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   |  s    		c         C   s   |  j  S(   N(   Rz   (   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRJ   ‡  s    c         C   s7   |  j  d  k r' t j |  j ƒ |  _  n  |  j  j | ƒ S(   N(   t#   _PatternElement__compiledExpressionR   t   ret   compileR~   t   match(   R   t   text(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   matches‰  s    N(   RK   RL   RM   t   sett!   _PatternElement__PrivateTransientR   R   t   addR~   Rz   R   R   RJ   R„   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRw   i  s   			t
   CF_patternc           B   sM   e  Z d  Z d Z e Z e j Z d Z
 d „  Z d „  Z d „  Z d „  Z RS(   s™  A facet that constrains the lexical representation of a value
    to match one of a set of patterns.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-pattern}

    @note: In PyXB, pattern constraints are ignored for any type with
    a Python representation that does not derive from a string type.
    This is due to the difficulty in reconstructing the lexical
    representation of a non-string type after it has been converted to
    its value space.

    @todo: On creating new instances of non-string simple types from
    string representations, we could apply pattern constraints.  That
    would mean checking them prior to invoking the Factory method.
    Rz   c         C   s   |  j  S(   N(   t   _CF_pattern__patternElements(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   patternElements£  s    c         K   s#   t  t |  ƒ j |   g  |  _ d  S(   N(   R   Rˆ   R   R‰   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   ¥  s    c         K   s#   |  j  |   } |  j j | ƒ | S(   N(   Rj   R‰   RF   (   R   R   Rz   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt
   addPattern©  s    c         C   sZ   d t  |  j ƒ k r t St | t j ƒ s/ t Sx$ |  j D] } | j | ƒ r9 t Sq9 Wt S(   Ni    (   t   lenR‰   R   R:   R   Ry   R„   R&   (   R   R   t   pe(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   ®  s    N(   RK   RL   RM   R   Rw   Rj   R    t   stringR(   R   R‰   RŠ   R   R‹   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRˆ   Ž  s   				t   _EnumerationElementc           B   st   e  Z d  Z d Z d „  Z d Z d „  Z d „  Z d Z	 d „  Z
 d Z d „  Z d d d d d d „ Z d „  Z RS(	   s^   This class represents individual values that appear within a
    L{CF_enumeration} collection.c         C   s   |  j  S(   sÝ   The Python value that is used for equality testing
        against this enumeration.

        This is an instance of L{enumeration.valueDatatype()<CF_enumeration.valueDatatype>},
        initialized from the unicodeValue.(   t   _EnumerationElement__value(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   Â  s    c         C   s   |  j  S(   s  The Python identifier used for the named constant representing
        the enumeration value.

        This should include any desired prefix, since it must be
        unique within its binding class.  If C{None}, no enumeration
        constant will be generated.(   t   _EnumerationElement__tag(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   tagË  s    c         C   s   | |  _  d S(   s,   Set the tag to be used for this enumeration.N(   R‘   (   R   R’   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   _setTagÓ  s    c         C   s   |  j  S(   sE   A reference to the L{CF_enumeration} instance that owns this element.(   t    _EnumerationElement__enumeration(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   enumerationØ  s    c         C   s   |  j  S(   s6   The unicode string that defines the enumeration value.(   t!   _EnumerationElement__unicodeValue(   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   unicodeValueÝ  s    c   	      K   sì   | j  d | ƒ } | d  k r' | } n  | d  k r@ | d } n  | |  _ | |  _ | |  _ | |  _ | |  _ |  j d  k	 s‚ t ‚ |  j ƒ  j	 ƒ  } | j
 | d t d t ƒ|  _ |  j d  k rè |  j d  k	 rè t j |  j ƒ |  _ n  d  S(   NR   Rh   t   _validate_constraintst	   _from_xml(   R%   R   R–   R”   t    _EnumerationElement__descriptiont   _EnumerationElement__annotationR‘   R   R•   R   t   FactoryR&   R   R   R   R>   (	   R   R•   t   unicode_valuet   descriptionR   R’   R   R   R!   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   á  s    						c         C   s   t  j |  j ƒ  ƒ S(   N(   R   t   QuotedEscapedR—   (   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRJ   ü  s    N(   RK   RL   RM   R   R   R   R‘   R’   R“   R”   R•   R–   R—   R   RJ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   ¼  s   					t   CF_enumerationc           B   s‰   e  Z d  Z d Z e Z e Z d Z	 d Z
 d Z d Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z RS(   s  Capture a constraint that restricts valid values to a fixed set.

    A STD that has an enumeration restriction should mix-in
    L{pyxb.binding.basis.enumeration_mixin}, and should have a class
    variable titled C{_CF_enumeration} that is an instance of this
    class.

    "unicode" refers to the Unicode string by which the value is
    represented in XML.

    "tag" refers to the Python member reference associated with the
    enumeration.  The value is derived from the unicode value of the
    enumeration element and an optional prefix that identifies the
    owning simple type when the tag is promoted to module-level
    visibility.

    "value" refers to the Python value held in the tag

    See U{http://www.w3.org/TR/xmlschema-2/#rf-enumeration}
    R•   c         K   sM   t  t |  ƒ j |   | j d |  j ƒ |  _ i  |  _ i  |  _ i  |  _ d  S(   Nt   enum_prefix(   R   R    R   R%   t   _CF_enumeration__enumPrefixt   _CF_enumeration__tagToElementt   _CF_enumeration__valueToElementt!   _CF_enumeration__unicodeToElement(   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR      s
    		c         C   s   |  j  S(   N(   R¢   (   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt
   enumPrefix'  s    c         C   s   t  t j |  ƒ ƒ S(   s2   @deprecated: Use L{items} or L{iteritems} instead.(   t   listR   R=   (   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   elements*  s    c         C   s&   g  t  j |  ƒ D] } | j ƒ  ^ q S(   s$   Return a list of enumeration values.(   R   R=   R   (   R   t   _ee(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   values.  s    c         c   s)   x" t  j |  ƒ D] } | j ƒ  Vq Wd S(   s    Generate the enumeration values.N(   R   R=   R   (   R   t   ee(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt
   itervalues2  s    c         K   s¾   |  | d <t  |   } | j |  j k s. t ‚ | |  j | j ƒ  <| |  j | j ƒ  <| j ƒ  } t | t ƒ rš d j	 g  | D] } | j
 ƒ  ^ q| ƒ } n  | |  j | <|  j ƒ  j | ƒ | S(   NR•   t    (   R   R’   R£   R   R¥   R—   R   R:   R§   R3   t
   xsdLiteralR¤   Rk   RF   (   R   R   R«   R   t   _v(    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   addEnumeration7  s    
+c         C   s   |  j  | S(   sŠ   Return the L{_EnumerationElement} instance that has the given value.

        @raise KeyError: the value is not valid for the enumeration.(   R¤   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   elementForValueF  s    c         C   s1   |  j  j | ƒ } | d k	 r- | j ƒ  } n  | S(   s‘   Return the enumeration value corresponding to the given unicode string.

        If ustr is not a valid option for this enumeration, return None.N(   R¥   R%   R   R   (   R   t   ustrRI   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   valueForUnicodeL  s    c         C   sP   d t  |  j ƒ  ƒ k r t Sx- t j |  ƒ D] } | j ƒ  | k r, t Sq, Wt S(   Ni    (   RŒ   Rk   R   R   R=   R   R&   (   R   R   R«   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   U  s    N(   RK   RL   RM   R   R   Rj   R&   RX   R   R£   R¤   R¥   R¢   R   R¦   R¨   Rª   R¬   R°   R±   R³   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR    ÿ  s"   									t   _Enumeration_mixinc           B   s   e  Z d  Z e d „  ƒ Z RS(   sL   Marker class to indicate that the generated binding has enumeration members.c         C   s   |  j  j | ƒ S(   N(   t   _CF_enumerationR³   (   R5   R²   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR³   a  s    (   RK   RL   RM   RN   R³   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR´   _  s   t   _WhiteSpace_enumc           B   s   e  Z d  Z RS(   s6   The enumeration used to constrain the whiteSpace facet(   RK   RL   RM   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR¶   e  s   R!   R   t   preserveR’   t   replacet   collapset   CF_whiteSpacec           B   sJ   e  Z d  Z d Z e Z e j d ƒ Z e j d ƒ Z	 d „  Z
 d „  Z RS(   sv   Specify the value-space interpretation of whitespace.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace}
    t
   whiteSpaces   [	
]s    +c         C   s§   |  j  ƒ  d k r | S|  j  ƒ  t j k r> t j | d t ƒS|  j  ƒ  t j k rf t j | d t ƒS|  j  ƒ  t j k s” t	 d |  j  ƒ  f ƒ ‚ t j | d t ƒS(   sW   Normalize the given string in accordance with the configured whitespace interpretation.R·   R¸   s*   Unexpected value "%s" for whiteSpace facetR¹   N(
   R   R   R¶   R·   R   t   NormalizeWhitespaceR   R¸   R¹   R   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   normalizeString|  s    .c         C   s   t  S(   s)   No validation rules for whitespace facet.(   R   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   ‡  s    (   RK   RL   RM   R   R¶   R(   R€   R   t   _CF_whiteSpace__TabCRLF_ret   _CF_whiteSpace__MultiSpace_reR½   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRº   r  s   	t   CF_minInclusivec           B   s#   e  Z d  Z d Z e Z d „  Z RS(   s|   Specify the minimum legal value for the constrained type.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-minInclusive}
    t   minInclusivec         C   s"   |  j  ƒ  d  k p! |  j  ƒ  | k S(   N(   R   R   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   “  s    (   RK   RL   RM   R   R&   RX   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRÀ   ‹  s   t   CF_maxInclusivec           B   s#   e  Z d  Z d Z e Z d „  Z RS(   s|   Specify the maximum legal value for the constrained type.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-maxInclusive}
    t   maxInclusivec         C   s"   |  j  ƒ  d  k p! |  j  ƒ  | k S(   N(   R   R   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   Ÿ  s    (   RK   RL   RM   R   R&   RX   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRÂ   —  s   t   CF_minExclusivec           B   s#   e  Z d  Z d Z e Z d „  Z RS(   sŽ   Specify the exclusive lower bound of legal values for the constrained type.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-minExclusive}
    t   minExclusivec         C   s"   |  j  ƒ  d  k p! |  j  ƒ  | k  S(   N(   R   R   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   ª  s    (   RK   RL   RM   R   R   RX   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRÄ   ¢  s   t   CF_maxExclusivec           B   s#   e  Z d  Z d Z e Z d „  Z RS(   sŽ   Specify the exclusive upper bound of legal values for the constrained type.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-maxExclusive}
    t   maxExclusivec         C   s"   |  j  ƒ  d  k p! |  j  ƒ  | k S(   N(   R   R   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   µ  s    (   RK   RL   RM   R   R   RX   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRÆ   ­  s   t   CF_totalDigitsc           B   s&   e  Z d  Z d Z e j Z d „  Z RS(   s€   Specify the number of digits in the *value* space of the type.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-totalDigits}
    t   totalDigitsc   	      C   sj  |  j  ƒ  d  k r t St | t j ƒ r– | j ƒ  j ƒ  \ } } } t | ƒ |  j  ƒ  k r_ t	 Sd | k r| | |  j  ƒ  k S| t | ƒ |  j  ƒ  k Sd } d } t	 } d  } xj | |  j  ƒ  k r| rt
 j | | ƒ } | | | k } |  j  ƒ  | k rPn  | d 7} | d 9} q± Wx* | |  j  ƒ  k  rG| d 7} | d 9} qW| oi| d  k	 oit | ƒ | k  S(   Ni    i   i
   (   R   R   R   R:   R    t   decimalt	   normalizet   as_tupleRŒ   R&   R   t	   long_typet   abs(	   R   R   t   signt   digitst   exponentt   nt   scaleR‚   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   À  s0    

(   RK   RL   RM   R   R    t   positiveIntegerR(   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRÈ   ¸  s   	t   CF_fractionDigitsc           B   s&   e  Z d  Z d Z e j Z d „  Z RS(   sŒ   Specify the number of sub-unit digits in the *value* space of the type.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-fractionDigits}
    t   fractionDigitsc         C   s¾   |  j  ƒ  d  k r t St | t j ƒ r` | j ƒ  j ƒ  \ } } } d | k p_ | |  j  ƒ  k Sd } d } xK | |  j  ƒ  k r¹ | | t j	 | | ƒ k r¢ t S| d 7} | d 9} qo Wt
 S(   Ni    i   i
   (   R   R   R   R:   R    RÊ   RË   RÌ   R   RÍ   R&   (   R   R   RÏ   RÐ   RÑ   RÒ   RÓ   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRQ   â  s    
(   RK   RL   RM   R   R    Rr   R(   RQ   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRÕ   Ú  s   	t   FundamentalFacetc           B   s8   e  Z d  Z d Z e d d „ ƒ Z d „  Z d „  Z RS(   sS   A fundamental facet provides information on the value space of the associated type.t   FFc         C   s>   |  j  | j d ƒ ƒ } | d | d | ƒ } | j | ƒ d  S(   NR6   R   R    (   R9   t   getAttributet   updateFromDOM(   R5   t   nodeR    R   R7   RI   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   CreateFromDOMö  s    	c         C   sS   | j  d ƒ s! t j d ƒ ‚ n  | j d ƒ |  j ƒ  k sB t ‚ |  j | ƒ d  S(   NR6   s   No name attribute in facet(   t   hasAttributeR1   t   SchemaValidationErrorRÙ   R   R   t   _updateFromDOM(   R   RÛ   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRÚ   ý  s    !c         C   s   y t  t |  ƒ j | ƒ Wn t k
 r- n X|  j ƒ  d  k	 rt | j d ƒ rt |  j |  j ƒ  | j d ƒ ƒ ƒ n  d  |  _	 |  S(   NR   (
   R   R×   Rß   t   AttributeErrorR   R   RÝ   R   RÙ   t   _FundamentalFacet__annotation(   R   RÛ   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRß     s    !%	N(	   RK   RL   RM   R0   RN   R   RÜ   RÚ   Rß   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR×   ñ  s   	t   FF_equalc           B   s   e  Z d  Z d Z RS(   sz   Specifies that the associated type supports a notion of equality.

    See U{http://www.w3.org/TR/xmlschema-2/#equal}
    t   equal(   RK   RL   RM   R   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRâ     s   t
   FF_orderedc           B   s,   e  Z d  Z d Z d Z e j Z d „  Z RS(   s|   Specifies that the associated type supports a notion of order.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-ordered}
    t   falset   partialt   totalt   orderedc         K   s   t  t |  ƒ j |   d  S(   N(   R   Rä   R   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR      s    (   s   falses   partials   total(	   RK   RL   RM   t   _LegalValuesR   R    RŽ   R(   R   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRä     s
   	t
   FF_boundedc           B   s   e  Z d  Z d Z e j Z RS(   s}   Specifies that the associated type supports a notion of bounds.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-bounded}
    t   bounded(   RK   RL   RM   R   R    Rf   R(   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRê   $  s   t   FF_cardinalityc           B   s,   e  Z d  Z d Z d Z e j Z d „  Z RS(   s   Specifies that the associated type supports a notion of length.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-cardinality}
    t   finites   countably infinitet   cardinalityc         K   s#   t  t |  ƒ j d t j |  d  S(   NR!   (   R   Rì   R   R    RŽ   (   R   R   (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyR   6  s    (   Rí   s   countably infinite(	   RK   RL   RM   Ré   R   R    RŽ   R(   R   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRì   -  s
   	t
   FF_numericc           B   s   e  Z d  Z d Z e j Z RS(   su   Specifies that the associated type represents a number.

    See U{http://www.w3.org/TR/xmlschema-2/#rf-numeric}
    t   numeric(   RK   RL   RM   R   R    Rf   R(   (    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyRï   :  s   R   Rz   s   [\i-[:]][\c-[:]]*s   \c+s   \i\c*s   -128t   127s   -2147483648t
   2147483647s   [\-+]?[0-9]+i    s!   [a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*s   -9223372036854775808t   9223372036854775807s   -1t   0t   1s   -32768t   32767t   255t
   4294967295t   18446744073709551615t   65535(o   RM   t   loggingR€   RÊ   R1   RE   R    R   t
   pyxb.utilsR   R   t	   getLoggerRK   RA   t   cscRootR   RO   RW   RG   R;   Rn   Rs   Ru   t   pyxb.utils.xmlret   PrivateTransient_mixinRw   Rˆ   t   python_2_unicode_compatiblet   objectR   R    R´   t   NMTOKENR¶   Rµ   R°   R<   R·   R¸   R¹   t   _InitializeFacetMapRº   RÀ   RÂ   RÄ   RÆ   RÈ   RÕ   R×   Râ   Rä   Rê   Rì   Rï   R4   t   extendt   ENTITIESt   _CF_patternt   _CF_maxLengthRr   t   _CF_minLengtht   _CF_whiteSpacet
   _CF_lengtht   ENTITYt   IDt   IDREFt   IDREFSt   NCNameR‹   t   NMTOKENSt   NOTATIONR   t   QNamet   anyURIt   base64BinaryRf   t   bytet   anySimpleTypet   _CF_minInclusivet   _CF_maxInclusivet   datet   _CF_maxExclusivet   _CF_minExclusivet   dateTimet   _CF_totalDigitst   _CF_fractionDigitst   doublet   durationt   floatt   gDayt   gMontht	   gMonthDayt   gYeart
   gYearMontht	   hexBinaryt   intt   integert   languaget   longt   negativeIntegert   nonPositiveIntegert   normalizedStringRÔ   t   shortRŽ   t   timet   tokent   unsignedBytet   unsignedIntt   unsignedLongt   unsignedShort(    (    (    sH   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/facets.pyt   <module>   s
  ‚*5(%.	B`'''"																														00																																																													0000000000									0000