
e#]c           @   s  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l	 Z	 d d l
 j Z d d l m Z m Z m Z d d l m Z d d l m Z m Z m Z e j e  Z e d  Z d e f d     YZ d	 e f d
     YZ d e f d     YZ d e f d     YZ  d e f d     YZ! d e f d     YZ" d e f d     YZ# d e f d     YZ$ d   Z% d   Z& d   Z' d   Z( d   Z) d   Z* d   Z+ d   Z, d   Z- d d l. Z	 d d l/ Z/ d d l0 Z0 d    Z1 d!   Z2 d" e f d#     YZ3 d$   Z4 d%   Z5 d&   Z6 d'   Z7 d(   Z8 d) e f d*     YZ9 d+ e f d,     YZ: d- e: f d.     YZ; d/ e: f d0     YZ< e e e g  d1  Z= d d l> Z> d d l? Z? d2 e f d3     YZ@ d S(4   s   The really ugly code that generates the Python bindings.  This
whole thing is going to be refactored once customized generation makes
it to the top of the task queue.iN(   t   utilityt	   templatest   six(   t   repr2to3(   t   basist	   datatypest   facetsc         C   se   | d  k r |  j } n  |  j t j k r5 d | f S|  j t j k rR d | f St d |    d  S(   Ns   pyxb.binding.datatypes.%ss   pyxb.binding.facets.%ss$   No standard name for module of value(   t   Nonet   __name__t
   __module__R   R   t
   ValueError(   t   valuet   text(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   PrefixModule$   s    t   ReferenceLiteralc           B   s>   e  Z d  Z d Z d Z d   Z d   Z d   Z d   Z	 RS(   sj   Base class for something that requires fairly complex activity
    in order to generate its literal value.c         K   s   | j  d  |  _ d  S(   Nt   type_definition(   t   gett   _ReferenceLiteral__ownerClass(   t   selft   kw(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   __init__8   s    c         C   s   | |  _  | S(   N(   t   _ReferenceLiteral__literal(   R   t   literal(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt
   setLiteral<   s    	c         C   s   |  j  S(   N(   R   (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt	   asLiteral@   s    c         K   s2   |  j  d  k	 r. d t |  j  |  | f } n  | S(   Ns   %s.%s(   R   R   t   pythonLiteral(   R   R   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _addTypePrefixC   s    N(
   R   R	   t   __doc__R   R   R   R   R   R   R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   -   s   			t   ReferenceFacetMemberc           B   s   e  Z d Z d    Z RS(   c         K   s   | j  d  } | d  k s3 t | t j  s3 t  | d  k	 rg | j d | j    t |  |  _	 n  | j  d |  j	  |  _	 t
 t |   j |   |  j |  j d |  j	 j   f |   d  S(   Nt   variableR   t   facet_classs   _CF_%s(   R   R   t
   isinstanceR   t   Facett   AssertionErrort
   setdefaultt   ownerTypeDefinitiont   typet!   _ReferenceFacetMember__facetClasst   superR   R   R   R   t   Name(   R   R   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   K   s    $N(   R   R	   R   R%   R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   H   s   t   ReferenceWildcardc           B   s   e  Z d Z d    Z RS(   c         K   s  | |  _  t t |   j |   i  } d | d <t j j j | j   k rc t	 j
 d |  | d <nt | j   t t f  r g  } xC | j   D]5 } | d  k r | j d   q | j | j    q Wd d j g  | D] } t |  ^ q  | d <nh t | j   t  st  | j   d } | d  k	 rC| j   } n  t	 j
 d d	 t |  | | d <| j   | d
 <|  j t	 j
 d |   d  S(   Ns   pyxb.binding.content.Wildcardt   Wildcards   %{Wildcard}.NC_anyt   ncs	   set([%s])t   ,i   s"   (%{Wildcard}.NC_not, %{namespace})t	   namespacet   pcsN   %{Wildcard}(process_contents=%{Wildcard}.PC_%{pc}, namespace_constraint=%{nc})(   t   _ReferenceWildcard__wildcardR&   R(   R   t   xst
   structuresR)   t   NC_anyt   namespaceConstraintR   t   replaceInTextR   t   sett	   frozensetR   t   appendt   urit   joinR   t   tupleR!   t   processContentsR   (   R   t   wildcardR   t   template_mapt
   namespacest   nst   _ns(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   [   s(    	
3"N(   R   R	   R   R.   R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR(   X   s   t   ReferenceSchemaComponentc           B   s   e  Z d Z d    Z RS(   c         K   s^   | |  _  | d } | j d t  } t t |   j |   | j | |  } |  j |  d  S(   Nt   binding_modulet   in_class(   t$   _ReferenceSchemaComponent__componentR   t   FalseR&   R@   R   t   referenceSchemaComponentR   (   R   t	   componentR   RA   RB   t   rv(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   w   s    	
N(   R   R	   R   RC   R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR@   t   s   t   ReferenceNamespacec           B   s   e  Z d Z d    Z RS(   c         K   sP   | d |  _  | d } t t |   j |   | j |  j   } |  j |  d  S(   NR,   RA   (   t   _ReferenceNamespace__namespaceR&   RH   R   t   referenceNamespaceR   (   R   R   RA   RG   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR      s
    
N(   R   R	   R   RI   R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyRH      s   t   ReferenceExpandedNamec           B   s   e  Z d Z d    Z RS(   c         K   sb   | d |  _  t t |   j |   |  j d t |  j  j   |  t |  j  j   |  f  d  S(   Nt   expanded_names#   pyxb.namespace.ExpandedName(%s, %s)(   t$   _ReferenceExpandedName__expandedNameR&   RK   R   R   R   R,   t	   localName(   R   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR      s    N(   R   R	   R   RM   R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyRK      s   t   ReferenceFacetc           B   s   e  Z d Z d    Z RS(   c         K   sY   | d |  _  t t |   j |   |  j d t |  j  j   |  |  j  j   f  d  S(   Nt   facets	   %s._CF_%s(   t   _ReferenceFacet__facetR&   RO   R   R   R   R#   R'   (   R   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR      s    N(   R   R	   R   RQ   R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyRO      s   t   ReferenceEnumerationMemberc           B   s   e  Z d Z d    Z RS(   c         K   sZ  | j  d  } | d  k s3 t | t j  s3 t  | j  d  } | d  k rr t | t j  sf t  | j } n  t | t j  s t  | j  d  |  _ |  j d  k r | d  k	 s t  | j	 |  |  _ n  t |  j t j
  s t  |  j j   d  k	 st  | j d | j    t t |   j |   |  j |  j |  j j   |   d  S(   Nt
   enum_valuet   facet_instancet   enumeration_elementR   (   R   R   R   R   t   _Enumeration_mixinR!   t   _CF_enumerationt   CF_enumerationt   enumerationElementt   elementForValuet   _EnumerationElementt   tagR"   t   valueDatatypeR&   RR   R   R   R   (   R   R   R   RT   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR      s     	$N(   R   R	   R   RY   R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyRR      s   c         K   s  t  |  t j  rT d j g  t j |   D]% \ } } d | t | |  f ^ q(  St  |  t j  r g  |  D] } t | |  ^ qm St  |  t j j	  r t t
 d |  |   St  |  t j t f  r t |   t t |   |   St  |  t j  rt t d |  |   St  |  t j  r5t |  |  j    St  |  t j j  r`t t d |  |   St  |  t  rt |  t j  rt |   St |  t j  rt |   Sn  t  |  t j  rt t d |  |   St  |  t j  rt |  j  St  |  t j  rt |  j    St  |  t j j   r;t t! |  |   St  |  t j j"  rct t# |  |   St  |  t$  r||  j%   St  |  t j j  rt& |  j'    St  |  t j( t j) t j* t j+ t j, f  rt j- j. j& |   St/ d t |   f   d  S(   Ns   , s   %s=%sRL   RS   R,   RP   s   Unexpected literal type %s(0   R   R   t   dictionary_typeR8   t	   iteritemsR   t	   list_typet   pyxbR,   t   ExpandedNameRK   t
   tuple_typeR4   R$   t   listR   RV   RR   R   t   simpleTypeDefinitionR   t	   NamespaceRH   t
   issubclassR    RO   t   _PatternElementt   patternR[   R   R/   R0   R)   R(   t   _SchemaComponent_mixinR@   R   R   R   R7   t	   none_typet   boolean_typet
   float_typet   integer_typest   string_typest   utilsR    t	   Exception(   R   R   t   kt   vt   _v(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR      sH    B 

-c      
      sz  | d } t  j d | j   d t } g  } | j t j d d |  d    d     f d      f d	   } | j d
  i    t |  j d  }	 xw |	 D]o }
 d t	    f } |   |
 <| j d | t
 |
 j  t
 |
 j  |
 j j   f  | j d | f  q Wi  } | j d  t |  j d  } xL| D]D} d t	 |  f } | | | <| j d  k	 r| j d  x: | j D], } | j d t | | | | |  f  qWn  | j d  k r| j d  nN | j d  x> t | j d  D]' } | j d   | j | j f  qWt | j t j j  ro| j d | j j   f  n | j \ } } t | t j j  r| j t j d d | j | |  d t
 | j     nh t | t j j  r8| j |  | j t j d d | j | j   |  d t
 | j    |  n  | j d | | j  | j! f  | j d  k	 r~| j d | f  n  | j d | f  qNWx | D] } | j d  xy t | j" d | D]b } | j d  | | j# f  t | j$ d  } | j d! d" j% t&   f d#   |    qW| j d$ | | f  qW| j d% |  j' | f  | j( |  d& | f S('   NRA   t   BuildAutomatont	   protecteds   
def %{name} ():
    # Remove this helper function from the namespace after it is invoked
    global %{name}
    del %{name}
    import pyxb.utils.fac as fac
t   namec         S   s6   t  |  j t j j  r% |  j j   S|  j d j   S(   Ni    (   R   t   symbolR/   R0   t
   ModelGroupt   facStateSortKey(   t   st(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   stateSortKey  s    c         S   s   |  j  j   S(   N(   t   metadataRz   (   t   cc(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   counterConditionSortKey  s    c            s     |  j   S(   N(   t   counterCondition(   t   ui(   R   (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   updateInstructionSortKey  s    c            se   |  j    } d } | d  k	 r-   |  } n  | g } | j t  t |  j d    t |  S(   Nit   key(   t   consumingStateR   t   extendt   mapt   sortedt   updateInstructionsR9   (   t   xitR{   t   sskt   keys(   R|   R   (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   transitionSortKey  s    	%s       counters = set()R   s   cc_%us:       %s = fac.CounterCondition(min=%s, max=%s, metadata=%r)s       counters.add(%s)s       states = []s   st_%us       sub_automata = []s       sub_automata.append(%s)s       final_update = Nones       final_update = set()s3       final_update.add(fac.UpdateInstruction(%s, %r))s       symbol = %rsG       symbol = pyxb.binding.content.WildcardUse(%{wildcard}, %{location})R;   t   locationsZ       symbol = pyxb.binding.content.ElementUse(%{ctd}._UseForTag(%{field_tag}), %{location})t	   field_tags`       %s = fac.State(symbol, is_initial=%r, final_update=final_update, is_unordered_catenation=%r)s&       %s._set_subAutomata(*sub_automata)s       states.append(%s)s       transitions = []s+       transitions.append(fac.Transition(%s, [s           %s ]))s
   ,
        c            s   d   |  j  |  j f S(   Ns   fac.UpdateInstruction(%s, %r)(   R   t   doIncrement(   t   _ui(   t   counter_map(    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   <lambda>Y  s    s&       %s._set_transitionSet(transitions)sC       return fac.Automaton(states, counters, %r, containing_state=%s)s   %s()()   R    t   PrepareIdentifiert   uniqueInModulet   TrueR6   R   R3   R   t   counterConditionst   lenR   t   mint   maxR}   t	   _locationt   statest   subAutomataR   t   _GenerateAutomatont   finalUpdateR   R   R   Rx   R/   R0   Ry   R)   R   t   ElementDeclarationt   importForDeclarationt   expandedNamet	   isInitialt   isUnorderedCatenationt   transitionSett   destinationR   R8   R   t   nullableR   (   t	   automatonR<   t   containing_statet   linesR   RA   Rw   t   au_srcR   t   sorted_counter_conditionsR~   t   cc_idt	   state_mapt   sorted_statesR{   t   st_idt   saR   t   particleRx   R   t	   sorted_ui(    (   R   R   R|   R   sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     sl    
		
8
-% =F 0c         K   ss   t  j |   } | d } i | j |  |  d 6} | j } | d  k rK d  Sg  } t | | d | |  } | | f S(   NRA   t   ctdR   (   t   _CTDAuxDatat   GetR   R   R   R   (   R   R   t   auxRA   R<   R   R   Rw   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   GenerateAutomaton_  s    
	c         C   s   |  d  k r t St |  t j j  s+ t  |  j   } d  } | j | j	   k rt | j
   j   } t | t j  S| j | j	   k r t S| j | j	   k r t St S(   N(   R   RD   R   R/   R0   t   SimpleTypeDefinitionR!   t   baseTypeDefinitiont   VARIETY_atomict   varietyt   primitiveTypeDefinitiont   pythonSupportRg   R   Ro   t   VARIETY_absentR   t   VARIETY_union(   t   tdt   ptdt   python_support(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _useEnumerationTagsj  s    c         K   s  | d } | j    } g  } t |   } xt j |  j    D] \ } } | d  k rt | |  j   j   k rt q> n  | d  k	 r | j   |  k r q> n  i  }	 t | t j	  }
 t | t j
  r |  } | j   r | j   } n  | |	 d <n  | d  k	 r=|
 s| j   |	 d <n  t | t j  r=| j   |	 d <q=n  t d |  d | |  } | j d | j | | |	 f |   | j | j | |   | d  k	 r> |
 r> xt j |  D]} t | t j  rt | j   t j j  rd | j | | j   | j   f |  } n+ d	 | j | | j   | j   f |  } | r| j   d  k	 rt d |  d
 | d | |  } | j d | j | |  | f  | j   d  k	 r| j d | j   | j   | j | |  f  qq| j d | f  n  t | t j  r| j d | j | | j f |   qqWq> q> W| rt j j j  |  j!   k r|  j   j" t j  } | d  k rx |  j#   D] } t |  sqn  | j   j" t j  } | d  k rqn  x t j |  D] } t | t j  st$  | j%   j   } t d |  d
 | d | |  } | j d d | j | | j   f  d | j |  | j   f f  qWqWqn  d t& |  k rd j' |  } n d j' |  } | j d | j |  |  | f  d  S(   NRA   t   value_datatypeR   t   enum_prefixR   R   s   %s = %s(%s)
s#   %s.addEnumeration(value=%s, tag=%s)s+   %s.addEnumeration(unicode_value=%s, tag=%s)RT   RU   s   %s = %s
s   %s_%s = %s
s   %s
s   %s.addPattern(pattern=%s)
s   %-50s%s
s   %s = %ss   # originally %s.%si   s   ,
   R+   s   %s._InitializeFacetMap(%s)
((   t	   bindingIOR   R   R_   R   R   R   R#   Rg   t   _CollectionFacet_mixint   _LateDatatype_mixint   LateDatatypeBindsSuperclassR   R   RX   t
   enumPrefixR   t   writeR   R6   R[   Ra   R,   Rb   R\   t   unicodeValueRR   Rh   Ri   R/   R0   R   R   R   R   t   memberTypeDefinitionsR!   t   enumerationR   R8   (   R   t	   generatorR   RA   t   outft   facet_instancest   gen_enum_tagt   fct   fit   argsett   is_collectiont   vdtt	   facet_vart   it   enum_configt   enum_membert   mtdt   etdt   map_args(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   GenerateFacets~  sr    
"$&.+#84!%2c         C   s   |  j    d  k	 rH | j d  | j d | j |  j    |  f  n; |  j   d  k	 r | j d | j |  j   |  f  n  d  S(   Ns
   fixed=Trues   unicode_default=%s(   t   fixedR   R6   R   t   default(   t	   vc_sourcet   aux_initRA   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _VCAppendAuxInit  s
    )c         C   sW   t  |  t j j  s d  S|  j   j t j  } | d  k	 rS | j   |  k rS | Sd  S(   N(	   R   R/   R0   R   R   R   R   RX   R#   (   t   stdt
   enum_facet(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   simpleTypeOwnedEnumerationFacet  s    c         C   s-  | j  |   } | j   } t t j j  } t   } i  } | | d <| | d <| | d <| j |  j   |  g } t	 |   d  k	 r | j d  n  i  } | j |  |  }	 | d <|  j   d  k	 r |  j   j   |	 k r t j d |  j   |	  n  d | d <d	 t |  k  r/d
 j |  | d <n  | j |  j   |  | d <|  j   d  k	 ryt j |  j    | d <n
 d | d <| j |  j   |  | d <t |  j    | d <|  j   d  k	 r|  j   j   | d <| j |  j   j    | d <n d | d <| j d   | d <d }
 t j j j |  j   k rad |
 } | d sd | d <qn@t j j j |  j   k rd |
 } | d sd | d <qnt j j j  |  j   k rd |
 d } | j |  j!   |  | d <| d st" j# d |  | d <qn t j j j$ |  j   k rd |
 d } d
 j g  |  j%   D] } | j | |  ^ qG | d <| d st" j# d |  | d <qn t& j' d   | j( t" j# | |   t) |  | |  |  j*   d  k	 r| j( t" j# d  d! | j |  j*   |  |  n  | j( t" j# d" |   d  S(#   NRA   t   class_keywordst   class_uniques$   pyxb.binding.basis.enumeration_mixinR   s   Simple type %s renamed to %st    t   superclassesi    s   , RL   t   qnames   [anonymous]t   namespaceReferencet   xsd_locationt   documentationt   documentation_exprs   
    """%{documentation}"""

    _ExpandedName = %{expanded_name}
    _XSDLocation = %{xsd_location}
    _Documentation = %{documentation_expr}
s@   
# The ur simple type: %{qname}
class %{std} (%{superclasses}):
s   The ur simple type.s@   
# Atomic simple type: %{qname}
class %{std} (%{superclasses}):
s   An atomic simple type.si   
# List simple type: %{qname}
# superclasses %{superclasses}
class %{std} (pyxb.binding.basis.STD_list):
s   
    _ItemType = %{itemtype}
t   itemtypes*   Simple type that is a list of %{itemtype}.sk   
# Union simple type: %{qname}
# superclasses %{superclasses}
class %{std} (pyxb.binding.basis.STD_union):
s(   
    _MemberTypes = ( %{membertypes}, )
t   membertypess.   Simple type that is a union of %{membertypes}.s   Unhandled STD varietysM   %{namespaceReference}.addCategoryObject('typeBinding', %{localName}, %{std})
RN   s%   _module_typeBindings.%{std} = %{std}
(+   t   moduleForComponentR   R5   R   Re   t   _ReservedSymbolsR4   R   R   R   R   R6   R   RN   t   _logt   warningR   R8   R   t	   text_typet   bindingNamespaceR   R   t
   annotationt   asDocStringR   R/   R0   R   R   R   R   t   VARIETY_listt   itemTypeDefinitionR   R3   R   R   Ra   t
   LogicErrorR   R   Rw   (   R   R   RA   R   R   R   R   t   parent_classesR<   t   binding_namet   common_templatet   templatet   _mt(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   GenerateSTD  sr    	


*

"






8
"c         K   s  i  } t  j |  j    | d <t |  j    | d <| j |  j   |  | d <|  j |  j   k r | j |  |  } | d <|  j   j	   | k r t
 j d |  j   |  n  | j |  j   |  | d <t j d |  | d <n | j |  j   |  | d	 <|  j   d  k	 r<| j t  j |  j     | d
 <n  |  j   rg| j |  j   |  | d <n  |  j   r| j |  j   |  | d <n  |  j   r| j |  j   |  | d <n  | j |  j   |  | d <|  j   r| j |  j   |  | d <n  g  } x8 d D]0 } | | k r| j d | | | f  qqW| j d | d f  t |  | | |  d | d <d t |  k  rd d j |  | d <n  | S(   NR   t   decl_locationR   t   classs   Element %s renamed to %sRN   sQ   %{namespaceReference}.addCategoryObject('elementBinding', %{localName}, %{class})t
   map_updatet   scopeR   t   abstractt   nillablet   defaultValuet   typeDefinitiont   substitution_groups   %s=%ss   location=%sR   t   element_aux_initi    s   , (   s   nillables   abstracts   scopes   documentation(   R   R   R   R   R   R   R   t   SCOPE_globalR  RN   R   R   Rw   R   R3   R   R   R  R	  R   R  t   substitutionGroupAffiliationR6   R   R   R8   (   t   edRA   R   R<   R   R   Rr   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   elementDeclarationMap5  s@    %"
c         C   sf   d   } d t  f d     Y} t |  t j j  s: t  | |   } |  j | |  | j   } | S(   s  Construct a L{FAC term tree<pyxb.utils.fac.Node>} for a L{particle<xs.structures.Particle>}.

    This translates the XML schema content model of particles, model
    groups, element declarations, and wildcards into a tree expressing
    the corresponding content as a regular expression with numerical
    constraints.

    @param node: An instance of L{xs.structures.Particle}

    @return: An instance of L{pyxb.utils.fac.Node}
    c         S   s  | d k r | j   \ } } t | t j j  s9 t  t |  t j j t j j f  s` t  |  j	 | j
    | j t j j j | |  f   n| r |  j	 | j
    | j |   n| j   \ } } | |  k s t  | j   \ } } d t |  k r| d } t |  t j j  rd |  j   k sLd |  j   k rt j j j | |  j   |  j   d |  } qn	t | t j j  st d | f   t |  t j j  st  |  j |  j   k rt j j j d |  |  } n |  j |  j   k r(t j j j d |  |  } n` |  j |  j   k sCt  t j t j  t! d   |  t"  smt  t j j j# d |  |  } | j |  d S(   s"  Helper for constructing a L{FAC term tree<pyxb.utils.fac.Node>}.

        This is passed to L{xs.structures.Particle.walkParticleTree}.

        @param node: An instance of L{xs.structures._ParticleTree_mixin}

        @param entered: C{True} entering an interior tree node, C{False}
        leaving an interior tree node, C{None} at a leaf node.

        @param arg: A list of pairs C{(particle, terms)} where C{particle}
        is the L{xs.structures.Particle} instance containing a list of
        L{term trees<pyxb.utils.fac.Node>}.
        i   i    R}   s   unexpected %sc         S   s   t  |  t j j j  S(   N(   R   Ra   Rp   t   fact   Node(   t   _s(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    N($   R   t   peekNodeTermPairR   R/   R0   t   ParticleR!   R   R)   t   _setFacStateSortKeyt   nextSequenceNumberR6   Ra   Rp   R  t   Symbolt   addNodet   popNodeTermPairR   t	   minOccurst	   maxOccurst   NumericalConstraintRy   t   C_CHOICEt
   compositort   Choicet
   C_SEQUENCEt   Sequencet   C_ALLt	   functoolst   reducet   operatort   and_R   R   t   All(   t   nodet   enteredt   argt   parent_particlet   termst   xnodet   siblingst   term(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _generateTermTree_visitoro  s4    '%
93(*t   TermTreeArgc           B   sP   e  Z d Z d Z d Z d    Z d   Z d   Z d   Z	 d   Z
 d   Z RS(   c         S   s+   d |  _  g  |  _ | |  j f g |  _ d  S(   Ni    (   t   _TermTreeArg__sequenceNumbert   _TermTreeArg__termTreeListt   _TermTreeArg__nodeTermPairs(   R   R*  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    		c         S   sA   d t  |  j  k s t  d t  |  j  k s6 t  |  j d S(   Ni   i    (   R   R6  R!   R5  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   termTree  s    c         S   s   |  j  d S(   Ni(   R6  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         S   s   |  j  j   S(   N(   R6  t   pop(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         S   s   |  j  j | g  f  d  S(   N(   R6  R6   (   R   R*  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         S   s   |  j  } |  j  d 7_  | S(   Ni   (   R4  (   R   RG   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    	N(   R   R	   R   R4  R5  R6  R   R7  R  R  R  R  (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR3    s   					(   t   objectR   R/   R0   R  R!   t   walkParticleTreeR7  (   R*  R2  R3  t   ttargt	   term_tree(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   BuildTermTreeb  s    	8c            s   d     d   }   f d   } g  g } |  j  | | |  d t |  k sU t  | d } d t |  k sw t  | d S(   s  Walk a term tree to determine which element declarations may
    appear multiple times.

    The bindings need to use a list for any Python attribute
    corresponding to an element declaration that can occur multiple
    times in the content model.  The number of occurrences is
    determined by the occurrence constraints on parent particles and
    the compositors of containing model groups.  All this information
    is available in the term tree used for the content model
    automaton.

    @param term_tree: A L{FAC term tree<pyxb.utils.fac.Node>}
    representing the content model for a complex data type.

    @return: Plurality data, as a pair C{(singles, multiples)} where
    C{singles} is a set of base L{element
    declarations<xs.structures.ElementDeclaration>} that are known to
    occur at least once and at most once in a region of the content,
    and C{multiples} is a similar set of declarations that are known
    to potentially occur more than once.c         S   sf   |  \ } } | \ } } | j  |  | j  | j |   | j |  | j |  | j |  d  S(   N(   t   updatet   intersectiont   difference_updatet   symmetric_difference_update(   t   parentt   childt   p1t   pmt   c1t   cm(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _ttMergeSets  s    c         S   s,   t  |  t j j j  r( | j g   n  d  S(   N(   R   Ra   Rp   R  t   MultiTermNodeR6   (   R*  t   posR,  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _ttPrePluralityWalk  s    c            s   t    } t    } | | f } t |  t j j j  r | j   } t |  t j j j  r x| | D]& \ } } | j |  | j |  qa Wqt |  t j j j	 t j j j
 f  s t  xM| D] }	   | |	  q Wn/t |  t j j j  r|  j \ }
 } t | t j j  r.| j | j    qt | t j j  rFqt | t  s[t  x | D] }	   | t |	   qbWn t |  t j j j  st  | d j   } | \ } } d |  j k r| j   | j   n) d |  j k rn | j |  | j   | d j |  d  S(   Nii    i   (   R4   R   Ra   Rp   R  RI  R8  R!  R>  R#  R)  R!   R  R}   R/   R0   R   t   addt   baseDeclarationR)   Rd   t   BuildPluralityDataR  R   t   clearR6   (   R*  RJ  R,  t   singlest	   multiplest   combinedt	   term_listt   t1t   tmt   ttR   R1  (   RH  (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _ttPostPluralityWalk  s@    		-

i   i    (   t   walkTermTreeR   R!   (   R<  RK  RW  R,  (    (   RH  sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyRN    s    		6	
R   c           B   sY   e  Z d  Z d Z d Z d Z d Z d Z d Z	 d   Z
 e d    Z e d    Z RS(   sI   Helper class holding information need in both preparation and generation.c         C   s   | |  _  |  | _ | j   d |  _ t |  j t j j  r t |  j  |  _	 |  j	 j
   |  _ t |  j	  \ |  _ |  _ n t   |  _ t   |  _ d  S(   Ni   (   R   t   _CTDAuxData__auxDatat   contentTypet   contentBasisR   R/   R0   R  R=  R7  t   buildAutomatonR   RN  t	   edSinglest   edMultiplesR4   (   R   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   B  s    		c         C   s
   |  |  S(   N(    (   t   clsR   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   CreateN  s    c         C   s   | j  S(   N(   RY  (   R_  R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   R  s    N(   R   R	   R   R   R[  R7  R]  R^  R   R   R   t   classmethodR`  R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   8  s   	c          K   s  | j  |   } | j   } d  } i  } | j |  |  } | d <|  j   d  k	 r |  j   j   | k r t j d |  j   |  n  |  j   } |  j	   }	 | j | |  | d <| j |  j
   |  | d <| j |  j   |  | d <|  j   d  k	 rt j |  j    | d <n
 d | d <t |  j    | d <| j d  |  | d	 <|	 | d
 <t |  j    | d <d  }
 |  j |	 k r|  j   d }
 | j |
 |  | d	 <nD |  j |	 k r|  j   d }
 n" |  j |	 k r|  j   d }
 n  |  j   d  k	 r |  j   j   | d <nh t |  j   t j j  rr|  j   j   d  k	 rr|  j   j   j   | d <n t j d |  | d <d } t } | j | |  | d <|  j   rt } d | d <| j    d  k	 st!  n  | r| d 7} n
 | d 7} t" t# j$ j%  } t&   } g  } g  } | j' d  t |
 t j j(  rt) j* |   } | j+ j, | j-  } | j.   j' d  xht/ | d d   D]Q} | | j- k } | j0   } | j1   |  k r| j2 t3 | | |   g  } t |  | d <| j' t j d |   d t4 |  k r.d | d <n d d j5 |  | d <t6 j7 d | d f | | d  t | d! <| j   d  k	 r| j t j | j     | d <q| j d   | d <n  | j1   |  k r| j' t j d" d# t j | j1   j    |  qn  | j8 |  | j   j   | d k rZt j d$ |  j   | j   | d  n  | j' t j d% d& | j | j   |  |  | j' t j d' |   | j.   j' t j d( d& | j | j   |  d | d |  qWt9 |  d) | | } | d  k	 r| \ } } | rN| j.   j' d* j5 |   | j.   j' d*  n  | j.   j' t j d+ d | d d, |  | j.   j' d*  qn  g  } x^t/ |  j:   d d-   D]A} | j;   } t | j1   t j j<  st! d. | j1   f   | j0   } | j1   |  k rS| j' t j d/ d# t j | j1   j    |  qn  t | t=  sht!  | } x" | j>   d  k	 r| j>   } qqW| | k r| j;   j0   j?   } | j' t j d0 |   n  | j@   d  k	 st!  | j | j@   d1 t | | d2 <t | j    | d3 <t | j    | d4 <| } | jA   d  k	 rZ| } n  g  } tB | | | |  | jC   r| j' d5  n  | jD   r| j' d6  n  d t4 |  k rd | d <n# | jE d d  d j5 |  | d <| j   d  k	 r$	| j t j | j     | d <n | j d   | d <| j8 |  | j' t j d |   | j   j   | d k r	t j d7 |  j   | j   | d  n  | j' t j d8 d& | j | j   |  |  | j' t j d' d | d |  qW|  jF   d  k	 r5
| j' d9 | j |  jF   |  f  n  |  jG   rQ
| j' d:  n  d; j5 |  | d< <d; j5 |  | d= <t j d> |  | d? <|  jH   d  k	 r
| d? c t j d@ dA | j |  jH   |  | 7<n  d j5 | dB dC j5 |  d* dD g  } | jI | |  d  S(E   NR   s   Complex type %s renamed to %st	   base_typeR   RL   R   s   [anonymous]R   t   simple_base_typet   contentTypeTagt   is_abstracti   R   s9   Complex type %{qname} with content type %{contentTypeTag}s\  
# Complex type %{qname} with content type %{contentTypeTag}
class %{ctd} (%{superclass}):
    """%{documentation}"""
    _TypeDefinition = %{simple_base_type}
    _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_%{contentTypeTag}
    _Abstract = %{is_abstract}
    _ExpandedName = %{expanded_name}
    _XSDLocation = %{xsd_location}
t
   superclasss(   pyxb.binding.basis.complexTypeDefinitionsj       _ElementMap = %{superclass}._ElementMap.copy()
    _AttributeMap = %{superclass}._AttributeMap.copy()
s,       _ElementMap = {}
    _AttributeMap = {}
s   # Base type is %{base_type}s   

R   c         S   s
   |  j    S(   N(   t   schemaOrderSortKey(   t   _c(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    t	   is_plurals   %{use}.name() : %{use}i    R   R   s   , s   %s_eltt   idt   privatet   element_bindings>   
    # Element %{id} (%{qname}) inherited from %{decl_type_en}t   decl_type_ens   Element use %s.%s renamed to %ss   
    # Element %{qname} uses Python identifier %{id}
    %{use} = pyxb.binding.content.ElementDeclaration(%{name_expr}, '%{id}', '%{key}', %{is_plural}, %{decl_location}, %{aux_init})
t	   name_exprsO   
    %{inspector} = property(%{use}.value, %{use}.set, None, %{documentation})
sd   
%{ctd}._AddElement(pyxb.binding.basis.element(%{name_expr}, %{typeDefinition}%{element_aux_init}))
RA   s   
s&   %{ctd}._Automaton = %{automaton_ctor}
t   automaton_ctorc         S   s   |  j    j   S(   N(   t   attributeDeclarationRg  (   t   _au(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    s   unexpected scope %ss5   
    # Attribute %{id} inherited from %{decl_type_en}s0   
    # Attribute %{id} is restricted from parentRB   t	   attr_typeR  t   use_locations   required=Trues   prohibited=Trues   Attribute %s.%s renamed to %ss   
    # Attribute %{qname} uses Python identifier %{id}
    %{use} = pyxb.binding.content.AttributeUse(%{name_expr}, '%{id}', '%{key}', %{attr_type}%{aux_init})
    %{use}._DeclarationLocation = %{decl_location}
    %{use}._UseLocation = %{use_location}s   _AttributeWildcard = %ss   _HasWildcardElement = Trues
   ,
        t   attribute_usest   element_usess$   _module_typeBindings.%{ctd} = %{ctd}t   registrationsM   
%{namespaceReference}.addCategoryObject('typeBinding', %{localName}, %{ctd})RN   s       s   
    s       _ElementMap.update({
        %{element_uses}
    })
    _AttributeMap.update({
        %{attribute_uses}
    })
%{registration}

(J   R   R   R   R   R   RN   R   R   R   t   _contentTypeTagR   R   R   R   R   R  t	   CT_SIMPLERZ  t   CT_MIXEDt   CT_ELEMENT_ONLYR   R   R   t   ownerR/   R0   R   R   R3   R   t   _isHierarchyRootRD   t   nameInBindingR!   R5   R   t   complexTypeDefinitionR   R4   R6   R  R   R   R]  t   unionR^  t
   postscriptR   t   _templateMapR  R>  R  R   R8   R    R   R   R   t   attributeUsesRp  t   ComplexTypeDefinitiont   dictt   restrictionOft   copyR  t   valueConstraintR   t   requiredt
   prohibitedt   insertt   attributeWildcardt   hasWildcardElementRw   R   (    R   R   R   RA   R   t   prolog_templateR<   R   Rb  t   content_type_tagt   content_basist   inherits_from_baseR   R   Ru  t   definitionsR   t   elementsR  Ri  t   ef_mapR   t	   auto_defnRo  R   Rt  t   aut   adt   au_mapt   aurR   R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   GenerateCTDV  s*   *



	*%()%3,	"4("	%)%)!		c         K   s   |  j    s t  | j |   } | j   } t |  | |  } | j d | j d  |   | j d d  | j |   | j	 t
 j d d | j |  j   |  |  |  j   d  k	 r | j   j t
 j d |   n  d  S(   NR  R  R   s   
%{class} = pyxb.binding.basis.element(%{name_expr}, %{typeDefinition}%{element_aux_init})
%{namespaceReference}.addCategoryObject('elementBinding', %{class}.name().localName(), %{class})
Rn  s7   
%{class}._setSubstitutionGroup(%{substitution_group})
(   t   _scopeIsGlobalR!   R   R   R  R"   R   R   R   R   R   R3   R   R  R  R6   (   R  R   R   RA   R   R<   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt
   GenerateED@  s    %c         C   s   | j  |   |  j   d <t |   r t |   } | d  k	 r xg t j |  D]S } | j   d  k sx t d | f   | j	 t
 j | j   | j  |     qM Wq n  d  S(   Nt   _uniques   %s already has a tag(   t   uniqueInClassR  R   R   R   R   R_   R\   R!   t   _setTagR    R   R   (   R   R   t   nsmt   module_contextR   t   ei(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _PrepareSimpleTypeDefinitionV  s    %c         C   sx   i | d 6} | j  |   |  j   d <t j |   } | j } x3 |  j   D]% } t | |  | | k | | |  qK Wd  S(   NRA   R  (   R  R  R   R`  R^  t   localScopedDeclarationst   _SetNameWithAccessors(   R   R   R  R  R   R   RQ  t   cd(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _PrepareComplexTypeDefinition_  s    	c   
      C   s  |  j    } | j |  } t |  t j j  s6 t  |  j   j   } |  j	   rp | j
 |  j   j    n  t j | |  } | | d <| | d <t j d | d j   | d |  | d <t j d | j d  |  | d	 <|  j   | k s t  |  j   d  k s8t d
 | d	 |  j   |  j   f   |  j | d	  |  j | d  t j d  t j | j    | j   |  j   f }	 t j |	 | d t | d <t j |  j    | d <t |  t j j  r| rt j d | d j   | d |  | d <n  | S(   NRj  t	   inspectorR4   i    i   t   mutatort   __t   _t   uses!   Use %s but binding name %s for %ss   %s_%s_%sRk  R   R   RL  t   appender(   R  R  R   R/   R0   t   _ScopedDeclaration_mixinR!   R   RN   t   overridesParentScopet   discardt   overriddenDeclarationt   uniqueNameInBindingR    R   t   uppert
   MakeUniquet   stript   _scopeR}  R   t   setNameInBindingt   setUniqueNameInBindingR   t   uR   R,   R   R   (
   RF   t	   containerRi  RA   R  R   t   use_mapR   t   unique_namet   key_name(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  g  s*    

,#;7/t	   BindingIOc           B   s   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 d   Z d   Z d   Z d	   Z RS(   c         K   sM  t  t |   j   | |  _ | d |  _ | d |  _ g  |  _ g  |  _ | j   |  _	 | j
 d t j  } |  j	 j i t t j j    d 6|  j d 6| d 6| d 6| j   d 6t j d	 6t t j  d
 6d j t t t j   d 6 t j   |  _ |  j rI|  j d d | j   } |  j j | j |   |  j j   n  d  S(   Nt   binding_file_patht   binding_filet   encodingt   datet   filePatht   codingRA   t   binding_tagt   pyxbVersiont   pyxb_versiont   .t   pythonVersions   # %{filePath}
# -*- coding: %{coding} -*-
# PyXB bindings for %{binding_tag}
# Generated %{date} by PyXB version %{pyxbVersion} using Python %{pythonVersion}
%{binding_preface}t   binding_preface(    R&   R  R   t   _BindingIO__bindingModulet   _BindingIO__bindingFilePatht   _BindingIO__bindingFilet   _BindingIO__prologt   _BindingIO__postscriptR  t   _BindingIO__templateMapR   Ra   t   _OutputEncodingR>  t   strt   datetimet   nowt
   bindingTagt   __version__R   R8   R   t   syst   version_infot   iot   StringIOt   _BindingIO__stringIOt   expandt   bindingPrefaceR   t   encodet   flush(   R   RA   R   R  t   prefacet(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s,    			"

 	c         C   s   |  j  S(   N(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   bindingFile  s    c         K   s,   |  j  j   } | j |  t j | |  S(   N(   R  R  R>  R   R3   (   R   R  R   RU  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         C   s#   |  j    j |  j d |   d  S(   Ns  # Unique identifier for bindings created at the same time
_GenerationUID = %{generation_uid_expr}

# Version of PyXB used to generate the bindings
_PyXBVersion = %{pyxb_version}
# Generated bindings are not compatible across PyXB versions
if pyxb.__version__ != _PyXBVersion:
    raise pyxb.PyXBVersionError(_PyXBVersion)

# A holder for module-level binding classes so we can access them from
# inside class definitions where property names may conflict.
_module_typeBindings = pyxb.utils.utility.Object()

# Import bindings for namespaces imported into schema
%{aux_imports}

# NOTE: All namespace declarations are reserved within the binding
%{namespace_decls}
(   t   prologR6   R  (   R   RU  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   appendPrologBoilerplate  s    c         K   s&   |  j  | |  } |  j j |  d  S(   N(   R  R  R   (   R   R  R   t   txt(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    c         C   s   |  j  S(   N(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   bindingModule  s    c         C   s   |  j  S(   N(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         C   s   |  j  S(   N(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         O   s   | j  |  j  t | |   S(   N(   R>  R  R   (   R   t   argsR   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    c         C   s<   |  j  } | j |  j j    | j |  j  d j |  S(   NR   (   R  R6   R  t   getvalueR   R  R8   (   R   RG   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   contents  s    	N(   R   R	   R   R  R  R  R  R  R  R   R  R  R  R   R  R  R  R  R   R  (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  ~  s"   									t   _ModuleNaming_mixinc           B   s  e  Z d# Z d# Z d# Z d# Z d# Z e d  d d g  Z	 e d  d d g  Z
 i  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 d   Z d   Z d# Z d   Z d   Z d# Z  d# Z! d   Z" d   Z# e$ d    Z% e$ d    Z& e$ d    Z' e$ d    Z( i  Z) d   Z* d   Z+ e, d  Z- d   Z. d# d  Z/ d   Z0 d   Z1 d    Z2 d!   Z3 d"   Z4 RS($   Ra   R  t   _module_typeBindingsc         C   s   |  j  S(   N(   t   _ModuleNaming_mixin__generator(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    c         O   s   t  t |   j | |   | |  _ t |  j t  s: t  d |  _ d |  _ g  |  _	 i  |  _
 t   |  _ |  j j   |  _ d  |  _ i  |  _ g  |  _ i  |  _ i  |  _ d  S(   Ni   (   R&   R  R   R  R   t	   GeneratorR!   t!   _ModuleNaming_mixin__anonSTDIndext!   _ModuleNaming_mixin__anonCTDIndext   _ModuleNaming_mixin__componentst%   _ModuleNaming_mixin__componentNameMapR4   t#   _ModuleNaming_mixin__uniqueInModulet   _ReferencedFromClassR  t(   _ModuleNaming_mixin__referencedFromClassR   t   _ModuleNaming_mixin__bindingIOt(   _ModuleNaming_mixin__importModulePathMapt*   _ModuleNaming_mixin__namespaceDeclarationst)   _ModuleNaming_mixin__referencedNamespacest"   _ModuleNaming_mixin__uniqueInClass(   R   R   R  R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    									c         C   sp  t  | t j j  s t  t  | t t j j j f  sS t d t |  f   t  | t	  r t j j
 | j   k r~ d  S| j   } n  t  | t j j j t f  s t  | |  j k rl| j   } d | j d d  d k rd |  j   k s t  d |  j k st  d  } n> t j d | j d d  |  j   d t } |  j j |  | |  j | <n  d  S(	   Ns   Unexpected type %sRa   R  i   i    t   ImportedBinding_R  Rv   (   R   Ra   R,   Rf   R!   R  t   archivet   ModuleRecordR$   t   NamespaceModulet	   XMLSchemat   moduleRecordt   NamespaceGroupModuleR  t
   modulePatht   splitR   R  R   R    R   t   replaceR   RL  (   R   t   modulet   module_path(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _importModule   s"    7$	c         C   s7  |  j  j |  } | d  k r3t   } | j |  j  t | t j j	  r | j t
 j j  t |  d  k	 r#| j t
 j j  q#n t | t j j  s t  | j   r | j t
 j j  n\ | j   } | j   j d  } | d  k	 st d | j   | j   f   | j |  | |  j  | <n  | S(   NR  s   Base %s of %s has no unique(   R  R   R   R4   R>  R  R   R/   R0   R   R   Re   R   R   t   enumeration_mixinR  R!   R|  R~  R   R  R   (   R   RF   RG   t   base_tdt   base_unique(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s"    	.c         C   s   |  j  S(   N(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   +  s    c         C   s7   |  j  d  k r0 t j j j |  j    |  _  n  |  j  S(   N(   t   _ModuleNaming_mixin__moduleUIDR   Ra   Rp   R    t   HashForTextt   _moduleUID_vx(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt	   moduleUID/  s    !c         C   s   t  t |    S(   N(   R  Rj  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR
  4  s    c         C   s   d |  j    |  j   f S(   s8  Return a distinct string recorded in the first 4096 bytes of the binding file.

        This is used to ensure uniqueness and avoid overwriting data
        belonging to a different binding.  The return value comprises
        the class-specialized L{_bindingTagPrefix_vx} with the
        L{moduleUID}.
        s   %s:%s(   t   _bindingTagPrefix_vxR  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  7  s    c         C   s    t  j d t |   f   d  S(   Ns0   Subclass %s does not define _bindingTagPrefix_vx(   Ra   R   R$   (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  A  s    c         C   s
   |  j    S(   s   Return a block of binding text (comment or code) serving as a preface.

        Normally this should describe the module contents.(   t   _bindingPreface_vx(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  D  s    c         C   s   d S(   NR   (    (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  I  s    c         C   s   i  } g  } xx t  j |  j  D]d \ } } |  | k s= t  | d  k	 ri | j d | j   | f  q | j d | j   f  q Wd j |  | d <d j |  j  | d <|  j	   | d <t
 |  j   j    | d <|  j |  |  j j   S(   Ns   import %s as %ss	   import %ss   
t   aux_importst   namespace_declst
   module_uidt   generation_uid_expr(   R   R_   R  R!   R   R6   R  R8   R  R  R   R   t   generationUIDt   _finalizeModuleContents_vxR  R  (   R   R<   R  t   mrt   as_path(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   moduleContentsL  s     c         C   s   |  j  S(   N(   t   _ModuleNaming_mixin__modulePath(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  \  s    c         C   s   | \ } } } | |  _  | |  _ | d  k rB |  j   j   } n  | d  k	 rZ | |  _ n  |  j   } t |  d | d | | |  _ d  S(   NR  R  (	   t$   _ModuleNaming_mixin__bindingFilePatht    _ModuleNaming_mixin__bindingFileR   R  R  R  t   _initialBindingTemplateMapR  R  (   R   t	   path_dataR  R  R  R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _setModulePath^  s    		c         C   sT   t  | t  r | j   } n  |  j | } | d k rF | j   } n  d | | f S(   s8   Python code reference to an object in an imported modules   %s.%sN(   R   R  R  R  R   R  (   R   R  Rw   R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   pathFromImportj  s    c         C   s   |  j  S(   N(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  s  s    c         C   s   t  |  |  _ d  S(   N(   R4   R  (   R   t   unique_in_module(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _initializeUniqueInModulex  s    c         C   s   |  j  S(   N(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   {  s    c         C   s   | |  j  | <| S(   N(   t.   _ModuleNaming_mixin__ComponentBindingModuleMap(   R_  RF   R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   BindComponentInModule~  s    c         C   s   |  j  j |  S(   N(   R   R   (   R_  RF   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   ComponentBindingModule  s    c         C   s   | |  j  | j   <| S(   N(   t$   _ModuleNaming_mixin__RecordModuleMapR  (   R_  R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _RecordModule  s    c         C   s   |  j  j |  S(   N(   R#  R   (   R_  t   module_record(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt
   _ForRecord  s    c         C   s   i  } | j    } | d  k r t | t j j  rW t j d |  j |  d t	 } nE t | t j j
  r t j d |  j |  d t	 } n t s t  t	 | d <n  t j | |  j |  } | |  j k s t  |  j j |  | |  j | <| S(   Nt   CTD_ANONRv   t   STD_ANON(   t
   bestNCNameR   R   R/   R0   R  R    R   R  R   R   RD   R!   R  R  R  R6   (   R   RF   R   RG   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _bindComponent  s    $$c         C   s   |  j  j |  S(   N(   R  R   (   R   RF   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   nameInModule  s    c         C   sb  | j    } | d  k	 s t  | j   } | d  k	 s< t  |  j   j   | j   k r} |  j |  |  j | | j    St	 j
 |  } | d  k	 s t d | | |  j   | j   f   | j j |  } | d  k rt |  t  r|  j   | j   k st  | j   } n  |  | k rH|  j |  |  j | |  } n | r^d | f } n  | S(   Ns,   No binding module for %s from %s in %s as %ss   _module_typeBindings.%s(   t   _objectOriginR   R!   R  R   R  R  R  R}  R  R"  R  R   R   R  R,   R   (   R   RF   RB   t   originR%  t   component_moduleRw   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyRE     s&    4-c         C   s   |  j  S(   N(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _referencedNamespaces  s    c         K   s   |  j  j |  } | d  k s4 t d |  | f   | j d  sY t d | | f   t j | |  j |  } |  j j	 |  | d  k r | j
   r d } q d t | j    f } n  |  j j d | | f  |  j j d | f  | |  j  | <| S(   Ns%   Module %s already has reference to %sRf   s   unexpected %s naming %ss&   pyxb.namespace.CreateAbsentNamespace()s:   pyxb.namespace.NamespaceForURI(%s, create_if_missing=True)s   %s = %ss9   %s.configureCategories(['typeBinding', 'elementBinding'])(   R  R   R   R!   t
   startswithR    R   R  R  RL  t   isAbsentNamespaceR   R7   R  R6   (   R   R,   Rw   t
   definitionR   RG   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   defineNamespace  s    "%	c      
   C   s  |  j  j |  } | d  k rt |  t  o< |  j   | k sF t  | j   se | j   se t  | j   r | j	   } n  | d  k r| j
   r d | j
   f } n d } d  } x t j |  j  D]} } t | t j j j  r| j   | k rJ|  j | d  } PqJq t | t  r(q t s t d t |  | f   q W| d  k rt |  t  o{|  j |  d  k	 rn  |  j | | | d t } d t |  j  k  st  n  | |  j  | <n  | S(   Ns   Namespace_%sRf   s!   unexpected import from type %s %sRv   i    (   R  R   R   R   R  R,   R!   t   isBuiltinNamespacet   isUndeclaredNamespacet   builtinNamespaceRepresentationt   prefixR   t   iterkeysR  Ra   R  R  R  R  RD   R$   t   moduleForNamespaceR3  R   R   R  (   R   R,   RG   t   nsnt   nsdeft   im(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyRJ     s2    (
&1c         C   s0  | } x" | j    d k	 r* | j    } q	 W| j   | j   k sI t  | j   j   } | d k rk d S| j   j   } t |  t  r |  j   j	   | j	   k } ni t |  t
  rt } xQ |  j   D]. } | j   j	   | j	   k r t } Pq q Wn t j d |    | r,|  j |  n  d S(   s  Import the binding from which the declaration came.

        Figure out where the declaration came from.  If it's not part
        of this binding, make sure we import the binding associated
        with the schema from which it came.  We need that, if not for
        something in the declaration itself, at least to be able to
        get the Namespace for the declaration's name.  None of this is
        relevant if the declaration has no namespace.Ns   Unhandled module naming(   t   _cloneSourceR   R   R!   R,   R,  R  R   R  R  R  R   t   namespaceModulesRD   Ra   R   R  (   R   t   declt   sdeclR>   R  t   need_importt   nm(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s&    	!c         O   s   |  j  j | |   S(   N(   R  R   (   R   R  R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    c         C   s   t  j d |  |  |  j |  x |  j D] } |  j |  } | d  k	 sQ t  | j |  } | d  k rr q* n  d } | | k r d | f } n  |  j j d | j	   | | | j
   f  q* Wd  S(   Ns   Importing to %s from %sR   s    as %ss   from %s import %s%s # %s
(   R   t   infoR  R  R+  R   R!   R  R   R  R   (   R   R  t   ct
   local_namet   rem_nameR   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   addImportsFrom  s    c         C   sk   |  j    rW |  j    j |  j   j t j   |  j    j   t j d |  j	  n t j d |   d  S(   Ns   Saved binding source to %ss   No binding file for %s(
   R  R   R  R  Ra   R  t   closeR   RC  R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   writeToModuleFile*  s
    %N(5   R   R	   R   R  R  R  R  R  R4   t   _UniqueInModuleR  R   R   R  R   R  R  R  R   R  R  R
  R  R  R  R  R  R  R  R  R  R  R  R  R  R   Ra  R!  R"  R$  R&  R#  R*  R+  RD   RE   R/  R3  RJ   R   R   RG  RI  (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s^   								
						
									-			R  c           B   s   e  Z d  Z d   Z d Z d   Z d Z d   Z d   Z	 d Z
 e j j   Z e j d d g  d   Z d Z d Z d   Z d Z e d	    Z i  Z d
   Z d   Z d   Z d   Z d d  Z d   Z d   Z d Z d Z d   Z d   Z  RS(   sl   This class represents a Python module that holds all the
    declarations belonging to a specific namespace.c         C   s   |  j  S(   N(   t   _NamespaceModule__namespace(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR,   6  s    c         C   s   |  j  S(   N(   t   _NamespaceModule__moduleRecord(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  :  s    c         C   s   |  j  S(   N(   t&   _NamespaceModule__namespaceGroupModule(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   namespaceGroupModule>  s    c         C   s   | |  _  d  S(   N(   RM  (   R   t   namespace_group_module(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setNamespaceGroupModule@  s    t   CreateFromDOMt   CreateFromDocumentc         C   s   |  j  S(   N(   t$   _NamespaceModule__namespaceGroupHead(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   namespaceGroupHeadG  s    c         C   s   |  j  S(   N(   t   _NamespaceModule__components(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   componentsInNamespaceL  s    c         C   s   |  j  j |  S(   N(   t$   _NamespaceModule__ComponentModuleMapR   (   R_  RF   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   ForComponentP  s    c         C   s   d S(   Nt   NM(    (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  U  s    c         C   se   |  j    } d | f g } | j   d  k	 rK | j d | j   f  n  | j d  d j |  S(   Ns   # Namespace %ss    [xmlns:%s]s   
R   (   R,   R7  R   R6   R8   (   R   R>   t   rvl(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  X  s    c         C   s)   |  j    j   r d St j |  j     S(   Nt   Absent(   R,   R1  R   R   (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR
  `  s    c         C   s   d t  |  j  k  S(   Ni   (   R   t    _NamespaceModule__namespaceGroup(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   namespaceGroupMultie  s    c         K   s   t  t |   j | |  |  j |  j  | |  _ |  j j   |  _ |  j |  j d  |  j	 |   | |  _
 |  j
 d  k	 r |  j j t j |  j
 |    n  i  |  _ i  |  _ |  j | j |    d  S(   NRf   (   R&   R  R   R  RJ  RL  R,   RK  R3  R$  RU  R   RW  R>  R  t   fromkeyst'   _NamespaceModule__namespaceBindingNamest&   _NamespaceModule__componentBindingNameR  t   modulePathData(   R   R   R%  t   mr_scct
   componentsR   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   h  s    		"		c         C   sJ   i d d 6t  |  j j    d 6|  j j   d 6|  j |  j  d 6} | S(   NR,   t
   moduleTypet   targetNamespacet   namespaceURIR   (   R   RK  R7   RJ   (   R   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  w  s
    
c         C   se   d | d <|  j    j   j d  |  j    j |  |  j    j   j |  j    j d |   d  S(   Ns   _six.text_typet	   _TextTypes   
from __future__ import unicode_literals
import pyxb
import pyxb.binding
import pyxb.binding.saxer
import io
import pyxb.utils.utility
import pyxb.utils.domutils
import sys
import pyxb.utils.six as _six
s  
def CreateFromDocument (xml_text, default_namespace=None, location_base=None):
    """Parse the given XML and use the document element to create a
    Python instance.

    @param xml_text An XML document.  This should be data (Python 2
    str or Python 3 bytes), or a text (Python 2 unicode or Python 3
    str) in the L{pyxb._InputEncoding} encoding.

    @keyword default_namespace The L{pyxb.Namespace} instance to use as the
    default namespace where there is no default namespace in scope.
    If unspecified or C{None}, the namespace of the module containing
    this function will be used.

    @keyword location_base: An object to be recorded as the base of all
    L{pyxb.utils.utility.Location} instances associated with events and
    objects handled by the parser.  You might pass the URI from which
    the document was obtained.
    """

    if pyxb.XMLStyle_saxer != pyxb._XMLStyle:
        dom = pyxb.utils.domutils.StringToDOM(xml_text)
        return CreateFromDOM(dom.documentElement, default_namespace=default_namespace)
    if default_namespace is None:
        default_namespace = Namespace.fallbackNamespace()
    saxer = pyxb.binding.saxer.make_parser(fallback_namespace=default_namespace, location_base=location_base)
    handler = saxer.getContentHandler()
    xmld = xml_text
    if isinstance(xmld, %{_TextType}):
        xmld = xmld.encode(pyxb._InputEncoding)
    saxer.parse(io.BytesIO(xmld))
    instance = handler.rootObject()
    return instance

def CreateFromDOM (node, default_namespace=None):
    """Create a Python instance from the given DOM node.
    The node tag must correspond to an element declaration in this module.

    @deprecated: Forcing use of DOM interface is unnecessary; use L{CreateFromDocument}."""
    if default_namespace is None:
        default_namespace = Namespace.fallbackNamespace()
    return pyxb.binding.basis.element.AnyCreateFromDOM(node, default_namespace)

(   R   R  R6   R  R  (   R   R<   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    

+c         C   sW   |  j  |  } | j |  |  } |  j rG |  j j  |  |  j } n  t j | |  S(   N(   R*  R  RM  R  R!  (   R   RF   t   ns_nameRA   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   bindComponent  s    	c         C   s   d |  j    |  j   f S(   Ns   NM:%s@%s(   R,   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   __str__  s    N(!   R   R	   R   R,   R   RK  R  RL  RN  RP  RM  R  RJ  R  R>  RT  RS  R\  RV  RU  Ra  RX  RW  R  R  R
  R]  R   R  R  R`  Ri  Rj  (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  2  s8   												;		R  c           B   s   e  Z d  Z d   Z d Z d   Z d Z d Z d Z	 e
   Z d Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z RS(   s   This class represents a Python module that holds all the
    declarations belonging to a set of namespaces which have
    interdependencies.c         C   s   |  j  S(   N(   t'   _NamespaceGroupModule__namespaceModules(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR>    s    c         C   s.   x' |  j  D] } | j   | k r
 | Sq
 Wd  S(   N(   Rk  R,   R   (   R   R,   RB  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR9    s    t   _groupc         K   sw   t  t |   j | |  d t |  k  s1 t  | |  _ | d j   |  _ |  j |  j	  |  j
 | j |    d  S(   Ni   i    (   R&   R  R   R   R!   Rk  RT  t)   _NamespaceGroupModule__namespaceGroupHeadR  RJ  R  Ra  (   R   R   t   namespace_modulesR   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    	c         C   s   i d d 6} | S(   Nt   namespaceGroupRd  (    (   R   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         C   s   d S(   Nt   NGM(    (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         C   sM   d g } x' |  j    D] } | j | j    q W| j d  d j |  S(   Ns   # Group contents:
s   
R   (   R>  R6   R  R8   (   R   RZ  R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s
    	c         C   s0   |  j    j   j d  |  j    j |  d  S(   Ns   
from __future__ import unicode_literals
import pyxb
import pyxb.binding
import pyxb.utils.utility
import pyxb.utils.six as _six
(   R   R  R6   R  (   R   R<   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         C   s{   g  } xR |  j    D]D } | j   } | j   rA | j d  q | j t j |   q W| j   t j d  j |  S(   NR[  t   ;(	   R>  R,   R1  R6   R   R   t   sortR  R8   (   R   t   nssR  R>   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR
     s    
c         C   s   d |  j    f S(   Ns   NGM:%s(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyRj    s    N(   R   R	   R   R>  R   Rk  R9  t!   _NamespaceGroupModule__componentst+   _NamespaceGroupModule__componentBindingNamet%   _NamespaceGroupModule__uniqueInModuleR4   t%   _NamespaceGroupModule__UniqueInGroupst   _GroupPrefixR   R  R  R  R  R
  Rj  (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    								
	c      	   K   s   t  d t d t |  } |  d  k	 r4 | j |   n | d  k	 rP | j |  n  | j   } d t |  k s t d | t |  t	 j
 d  j g  | D] } t	 j |  ^ q  f   | j   j   S(   Nt   allow_absent_modulet   generate_to_filesi   s   %s produced %d modules: %st    (   R  R   RD   R   t   addSchemaLocationt	   addSchemat   bindingModulesR   R!   R   R  R8   R   R8  R  (   t   schema_locationt   schema_textR,   t   module_prefix_eltsR   R   t   modulest   _m(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   GeneratePython  s    _R  c           B   s4  e  Z d  Z d Z d   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 i  Z d   Z d   Z d` 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) d   Z* d` Z+ d   Z, d` Z- d   Z. d    Z/ d` Z0 d!   Z1 d"   Z2 d#   Z3 d` Z4 d$   Z5 d%   Z6 d&   Z7 d` Z8 d'   Z9 d(   Z: d` Z; d)   Z< d*   Z= d+   Z> d` Z? d,   Z@ d-   ZA d` ZB d.   ZC d/   ZD d` ZE d0   ZF d1   ZG d` ZH d2   ZI d3   ZJ d` ZK d4   ZL d5   ZM d` ZN d6   ZO d7   ZP d` ZQ d8   ZR d9   ZS d` ZT d:   ZU eV jW d;  ZX d<   ZY d= e f d> e f d? e f d@ e f dA e f dB e& f dC e* f dD e/ f dE e2 f dF e6 f dG e: f dH eA f dI eD f dJ eG f dK eM f dL eJ f dM eP f dN eS f f ZZ d` dO  Z[ d` dP  Z\ dQ   Z] d` Z^ e dR  Z_ d` Z` dS   Za dT   Zb d` dU  Zc e Zd dV   Ze dW   Zf dX   Zg d` Zh d` Zi d` Zj dY   Zk dZ   Zl d[   Zm d\   Zn d` Zo d]   Zp d^   Zq d_   Zr RS(a   s>   Configuration and data for a single binding-generation action.R  c         C   s   |  j  S(   sX   The directory path into which generated bindings will be written.
        @rtype: C{str}(   t   _Generator__bindingRoot(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   bindingRoot&  s    c         C   s   | |  _  |  S(   N(   R  (   R   t   binding_root(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setBindingRoot*  s    	c         C   s   t  | t j  r$ | j d  } n | } d t |  k  sC t  | s{ | d j d  sc t  d | d f | d <n  t j j	 |  j
   |  S(   NR  i    is   .pys   %s.py(   R   R   Ro   R   R   R!   t   endswitht   ost   pathR8   R  (   R   t   module_eltst   inhibit_extension(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   __moduleFilePath/  s    c         C   s   |  j  S(   N(   t   _Generator__generateToFiles(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   generateToFiles:  s    c         C   s  d  } t | t  r| j   } | d  k r1 d S|  j   | j   k rM d S|  j   s] d S| j   j   r |  j   r d S| j	   } | d  k	 s t
 d | f   | j d  } |  j   rT|  j |  } | j d d  t j j |  sTd j |  } t j j j |  } d | f } | j d  }	 | j |	  | j   qTn  |  j |  }
 y% t j j j |
 d | j   } Wq:t k
 r} t j | j k rt j d	 |
 | f   n    q:Xnht | t  r.|  j   st j d
   n  g  } |  j    r<| j! t" t j# |  j    j d    n  |  j   rX| j$ d  n  t%   } x t& r| j$ t j j j' d | d t&  yQ |  j |  }
 t( j) d | | j   |
  t j j j |
 d | j   } PWn+ t k
 r} t j | j k r  qn X| j*   qdWd j |  } n t+ s:t
  |  j   rxu t, t- |  d  D]Z } |  j | d |  d t& } t j j | d  } t j j |  s]t. | d  q]q]Wn  |
 | | f S(   Ns	   /dev/nulls   No path specified for module %sR  it   raws)   # -*- coding: utf-8 -*-
from %s import *
s   utf-8R\   s?   Target file %s for module %s bindings exists with other contents9   Generation of namespace groups requires generate-to-filest   nsgroupRv   s    Attempting group %s uid %s at %si   R  s   __init__.pyt   w(   s	   /dev/nullNN(   s	   /dev/nullNN(   s	   /dev/nullNN(   s	   /dev/nullNN(/   R   R   R  R  R  R  R,   R4  t   allowBuiltinGenerationR  R!   R   t   writeForCustomizationt   _Generator__moduleFilePathR  R  R  t   existsR8   Ra   Rp   R    t   OpenOrCreateR  R   RH  R  t   OSErrort   errnot   EEXISTt   BindingGenerationErrorR  t   modulePrefixR   R   t   MakeModuleElementR6   R4   R   R   R   RC  R8  RD   t   rangeR   t   open(   R   R  R  R  R  t   import_file_patht   raw_module_patht   fdt   imptt   impdR  R  t   et   in_uset   nt   sub_patht	   init_path(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyRa  >  sx    %
+		%!
c         C   s   |  j  S(   sb   The directory from which entrypoint schemas specified as
        relative file paths will be read.(   t   _Generator__schemaRoot(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt
   schemaRoot  s    c         C   s/   | j  t j  s" | t j } n  | |  _ |  S(   N(   R  R  t   sepR  (   R   t   schema_root(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setSchemaRoot  s    	c         C   s   |  j  S(   s   Optional string that is stripped from the beginning of
        schemaLocation values before loading from them. This now
        applies only to URIs specified on the command line so is
        unlikely to be useful.
        (   t    _Generator__schemaStrippedPrefix(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   schemaStrippedPrefix  s    c         C   s   | |  _  |  S(   N(   R  (   R   t   schema_stripped_prefix(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setSchemaStrippedPrefix  s    	c         C   s   |  j  S(   s}  Optional map to rewrite schema locations.

        This applies only to the values of schemaLocation attributes
        in C{import} and C{include} elements.  Its purpose is to
        convert remote or absolute schema locations into local or
        relative ones to allow offline processing when all schema are
        available in a local directory.  See C{schemaRoot}.
        (   t$   _Generator__locationPrefixRewriteMap(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   locationPrefixRewriteMap  s    	c         C   s!   |  j  j   |  j  j |  |  S(   N(   t   _Generator__locationPrefixMapRO  R>  (   R   t   location_prefix_rewrite_map(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setLocationPrefixRewriteMap  s    c         C   s   | |  j  | <|  S(   s  Add a rewrite entry for schema locations.

        @param prefix : A text prefix that should be removed from
        schema location URIs.

        @param substituent : The text prefix that should replace
        C{prefix} as a prefix in a schema location URI.
        (   R  (   R   R7  t   substituent(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   addLocationPrefixRewrite  s    
c         C   s=   y | j  d d  \ } } Wn
   n X|  j | |  d S(   s  Add a rewrite entry for schema locations.

        Parameter values are strings of the form C{pfx=sub}.  The
        effect is that a schema location that begins with C{pfx} is
        rewritten so that it instead begins with C{sub}.

        This applies to schemaLocation attributes in C{import} and
        C{include} elements.  It may be used to convert absolute
        schema locations into relative ones to allow offline
        processing when all schema are available in a local
        directory.  See C{schemaRoot}.
        t   =i   N(   R   R  (   R   t   prefix_rewriteR7  R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   argAddLocationPrefixRewrite  s
    c         C   s   |  j  S(   s  A list of locations from which entrypoint schemas are to be
        read.

        The values in the list are either URIs, or tuples consisting
        of a value and a callable which, when passed the generator
        object and the value, will return a
        L{pyxb.xmlschema.structures.Schema} instance.  See
        L{addSchemaLocation}.

        See also L{addSchemaLocation} and L{schemas}.
        (   t   _Generator__schemaLocationList(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   schemaLocationList  s    c         C   s   g  |  j  (|  j  j |  |  S(   N(   R  R   (   R   t   schema_location_list(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setSchemaLocationList  s    
c         C   s   |  j  j | | f  |  S(   s	  Add the location of an entrypoint schema.

        @param schema_location: The location of the schema.  This
        should be a URL; if the schema location does not have a URL
        scheme (e.g., C{http:}), it is assumed to be a file, and if it
        is not an absolute path is located relative to the
        C{schemaRoot}.

        @keyword converter: Optional callable that will be invoked
        with the generator instance and the schema location, and is
        expected to return a L{pyxb.xmlschema.structures.Schema}
        instance.  If absent, the contents of the location are
        converted directly.

        @note: The C{converter} argument derives from WSDL support: we
        need to add to the sequence of schema locations a URI of
        something that will not parse as a schema, but does have inner
        material that can if treated properly.  "Treated properly" may
        include having the archive path and other namespace
        manipulations configured before anything is done to it.
        (   R  R6   (   R   R  t	   converter(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR|    s    c         C   s   |  j  |  d S(   s  Add the location of an entrypoint schema.  The provided
        value should be a URL; if it does not have a URL scheme (e.g.,
        C{http:}), it is assumed to be a file, and if it is not an
        absolute path is located relative to the C{schemaRoot}.N(   R|  (   R   R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   argAddSchemaLocation  s    c         C   s   |  j  S(   s  Schema for which bindings should be generated.

        These may be L{Schema<pyxb.xmlschema.structures.Schema>}
        instances, or strings; the latter is preferred, and is parsed
        into a Schema instance when required.

        This is the list of entrypoint schemas for binding generation.
        Values in L{schemaLocationList} are read and converted into
        schema, then appended to this list.  Values from L{moduleList}
        are applied starting with the first schema in this list.
        (   t   _Generator__schemas(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   schemas  s    c         C   s   g  |  j  (|  j  j |  |  S(   N(   R  R   (   R   R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt
   setSchemas
  s    
c         C   s   |  j  j |  |  S(   N(   R  R6   (   R   t   schema(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR}    s    c         C   s   |  j  j   S(   s  The set of L{namespaces<pyxb.namespace.Namespace>} for
        which bindings will be generated.

        This is the set of namespaces read from entrypoint schema,
        closed under reference to namespaces defined by schema import.

        @rtype: C{set}
        (   t   _Generator__namespacesR  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR=     s    	c         C   s!   |  j  j   |  j  j |  |  S(   N(   R  RO  R>  (   R   t   namespace_set(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setNamespaces  s    c         C   s   |  j  j |  |  S(   N(   R  RL  (   R   R,   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   addNamespace!  s    c         C   s   |  j  S(   sU   A list of module names to be applied in order to the namespaces of entrypoint schemas(   t   _Generator__moduleList(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt
   moduleList&  s    c         C   s   g  |  j  (|  j  j |  |  S(   N(   R  R   (   R   t   module_list(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _setModuleList)  s    
c         C   s   |  j  j |  |  S(   s   Add a module name corresponding to an entrypoint schema.

        The namespace defined by the corresponding schema will be
        written to a binding using the given module name, adjusted by
        L{modulePrefix}.(   R  R6   (   R   t   module_name(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   addModuleName.  s    c         C   s   |  j  S(   s2  The prefix for binding modules.

        The base name for the module holding a binding is taken from
        the moduleList, moduleMap, or an XMLNS prefix associated with
        the namespace in a containing schema.  This value, if present,
        is used as a prefix to allow a deeper module hierarchy.(   t   _Generator__modulePrefix(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  8  s    c         C   s   | |  _  |  S(   N(   R  (   R   t   module_prefix(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setModulePrefix@  s    	c         C   s   |  j  S(   s  A map from namespace URIs to the module to be used for the
        corresponding generated binding.

        Module values are adjusted by L{modulePrefix} if that has been
        specified.

        An entry in this map for a namespace supersedes the module
        specified in moduleList if the namespace is defined by an
        entrypoint schema.

        @return: A reference to the namespace module map.
        (   t   _Generator__namespaceModuleMap(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   namespaceModuleMapE  s    c         C   s   |  j  S(   s  A colon-separated list of paths from which namespace
        archives can be read.

        The default path is the contents of the C{PYXB_ARCHIVE_PATH}
        environment variable, or the standard path configured at
        installation time.  Any file with the extension C{.wxs} found
        in one of these directories is examined to see whether it is a
        namespace archive.
        (   t   _Generator__archivePath(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   archivePathU  s    
c         C   s   | |  _  |  S(   N(   R  (   R   t   archive_path(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setArchivePath`  s    	c         C   s   t  |  j  S(   sB   A frozenset of namespaces that must not be loaded from an archive.(   R5   t   _Generator__noLoadNamespaces(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   noLoadNamespacese  s    c         C   s@   |  j  j   |  j  j g  | D] } t j j |  ^ q  d S(   s   Record the set of namespaces that should not be loaded from an archive.

        The expectation is that any required entities in the namespace
        will be defined by loading schema.N(   R  RO  R>  Ra   R,   t   NamespaceInstance(   R   R  R?   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _setNoLoadNamespacesh  s    c         C   s    |  j  j t j j |   d S(   s}  Mark that the specified namespace should not be loaded from an archive.

        Use this when you are generating bindings for an application
        that has a restricted profile of a namespace that would
        otherwise be read from an archive.  Be aware that this removes
        any knowledge of any archive in which this namespace is
        present as a non-private member.N(   R  RL  Ra   R,   R  (   R   R,   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   addNoLoadNamespaceo  s    c         C   s   t  |  j  S(   s7   A list of namespaces for which new bindings are allowd.(   R5   t'   _Generator__importAugmentableNamespaces(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   importAugmentableNamespacesz  s    c         C   s@   |  j  j   |  j  j g  | D] } t j j |  ^ q  d S(   sH   Return the set of namespaces that may be augmented by import directives.N(   R  RO  R>  Ra   R,   R  (   R   R  R?   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _setImportAugmentableNamespaces}  s    c         C   s    |  j  j t j j |   d S(   sX  Mark that the specified namespace may be imported by new bindings.

        Normally namespaces that are available from archives are
        considered to be complete, and schema locations in import
        directives are ignored.  Use this to indicate that the
        bindings being generated import new bindings.

        Note that attempts to import schema that contributed to the
        archive will only be detected if the archive was generated
        from the same schemaLocation URI; if the archive was generated
        from a different source component definitions might
        conflict.N(   R  RL  Ra   R,   R  (   R   R,   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   addImportAugmentableNamespace  s    c         C   s   |  j  S(   s?  Optional file into which the archive of namespaces will be written.

        Subsequent generation actions can read pre-parsed namespaces
        from this file, and therefore reference the bindings that were
        built earlier rather than re-generating them.

        The file name should normally end with C{.wxs}.(   t   _Generator__archiveToFile(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   archiveToFile  s    c         C   s   | |  _  |  S(   N(   R  (   R   t   archive_to_file(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setArchiveToFile  s    	c         C   s#   t  j j |  } | |  j | <d  S(   N(   Ra   R,   R  t"   _Generator__namespaceVisibilityMap(   R   R,   t
   visibility(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setNamespaceVisibility  s    c         C   sy   | d  k r t   } n  | d  k r0 t   } n  |  j j   |  j j t j | t   |  j j t j | t   d  S(   N(	   R   R4   R  RO  R>  R  R^  R   RD   (   R   t   publicRk  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   _setNamespaceVisibilities  s    c         C   s   |  j  j   S(   sp   Indicates, for specific namespaces, whether their
        visibility in the archive should be public or private.(   R  R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   namespaceVisibilityMap  s    c         C   s   |  j  S(   s  Indicates whether unmentioned namespaces will be public or private (default) in the archive.

        A namespace is I{mentioned} if it is the target namespace of
        an entrypoint schema, or appears in a namespace visibility
        specification.  I.e., this default applies only to namespaces
        that are modified as a result of including some schema, which
        is generally a local customization of something.
        (   t"   _Generator__defaultNamespacePublic(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   defaultNamespacePublic  s    	c         C   s   | |  _  d  S(   N(   R  (   R   t   default_namespace_public(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setDefaultNamespacePublic  s    c         C   s   |  j  S(   s[   Indicates whether the bindings should validate mutations
        against the content model.(   t   _Generator__validateChanges(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   validateChanges  s    c         C   s   | |  _  |  S(   N(   R  (   R   t   validate_changes(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setValidateChanges  s    	c         C   s   |  j  S(   s*  Indicates whether the binding Python code should be written into a sub-module for customization.

        If enabled, a module C{path.to.namespace} will be written to
        the file C{path/to/raw/namespace.py}, so that the file
        C{path/to/namespace.py} can import it and override behavior.(   t!   _Generator__writeForCustomization(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         C   s   | |  _  |  S(   N(   R  (   R   t   write_for_customization(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setWriteForCustomization  s    	c         C   s   |  j  S(   s   Indicates whether the code generator is permitted to
        process namespace for which no module path can be determined.

        Use this only when generating bindings that will not be
        referenced by other bindings.(   t   _Generator__allowAbsentModule(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   allowAbsentModule  s    c         C   s   | |  _  |  S(   N(   R  (   R   Ry  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setAllowAbsentModule  s    	c         C   s   |  j  S(   s8  Indicates whether bindings will be written for namespaces that are built-in to PyXB.

        This must be enabled when building bindings for the XML,
        XMLSchema instance, and other built-in namespaces.  Normally
        generation of these namespaces is inhibited lest it produce
        inconsistencies.(   t"   _Generator__allowBuiltinGeneration(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR    s    c         C   s   | |  _  |  S(   N(   R  (   R   t   allow_builtin_generation(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setAllowBuiltinGeneration  s    	c         C   s   |  j  S(   s   The directory path into which any content retrieved by URI will be written.

        This serves as a local cache, and to give you an opportunity
        to inspect material retrieved from some other system.
        @rtype: C{str}(   t&   _Generator__uriContentArchiveDirectory(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   uriContentArchiveDirectory  s    c         C   s   | |  _  d  S(   N(   R  (   R   t   ucad(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setUriContentArchiveDirectory  s    c         C   s   |  j  S(   s   A file provided to L{logging.config.fileConfig} to control log messages.

        In the absence of other configuration the Python standard logging infrastructure is used in its
        default configuration.

        @rtype: C{str}(   t   _Generator__loggingConfigFile(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   loggingConfigFile  s    c         C   s   | |  _  d  S(   N(   R  (   R   t   logging_config_file(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setLoggingConfigFile 	  s    c         O   s  | j  d  } | d k	 r$ i  } n  | j  d |  j  |  _ | j  d t j   t j j  |  _ | j  d  |  _	 | j  d i   |  _
 g  |  _ | j  d g   |  _ | j  d g   |  _ | j  d  |  _ | j  d	 t j j j    |  _ | j  d
 t    j   |  _ | j  d t    j   |  _ | j  d  |  _ i  |  _ |  j | j  d t    | j  d t     | j  d t  |  _ | j  d t  |  _ | j  d i   j   |  _ | j  d g   |  _ t | j  d g    |  _  | j  d t  |  _! | j  d t  |  _" | j  d t  |  _# | j  d t  |  _$ | j  d  |  _% | j  d  |  _& t   |  _' | d k	 r|  j( |  j)   j* |    n  g  | D] } |  j+ |  ^ qt j, j- j.   |  _/ t j j0 j1   d S(   s)  Create a configuration to be used for generating bindings.

        Arguments are treated as additions to the schema location list
        after all keywords have been processed.

        @keyword binding_root: Invokes L{setBindingRoot}
        @keyword schema_root: Invokes L{setSchemaRoot}
        @keyword schema_stripped_prefix: Invokes L{setSchemaStrippedPrefix}
        @keyword location_prefix_rewrite_map: Invokes L{setLocationPrefixRewriteMap}
        @keyword schema_location_list: Invokes L{setSchemaLocationList}
        @keyword module_list: Invokes L{_setModuleList}
        @keyword module_prefix: Invokes L{setModulePrefix}
        @keyword archive_path: Invokes L{setArchivePath}
        @keyword no_load_namespaces: Invokes L{_setNoLoadNamespaces}
        @keyword import_augmentable_namespaces: Invokes L{_setImportAugmentableNamespaces}
        @keyword archive_to_file: Invokes L{setArchiveToFile}
        @keyword public_namespace: Invokes L{setNamespaceVisibility}
        @keyword private_namespace: Invokes L{setNamespaceVisibility}
        @keyword default_namespace_public: Invokes L{setDefaultNamespacePublic}
        @keyword validate_changes: Invokes L{setValidateChanges}
        @keyword namespace_module_map: Initializes L{namespaceModuleMap}
        @keyword schemas: Invokes L{setSchemas}
        @keyword namespaces: Invokes L{setNamespaces}
        @keyword write_for_customization: Invokes L{setWriteForCustomization}
        @keyword allow_builtin_generation: Invokes L{setAllowBuiltinGeneration}
        @keyword allow_absent_module: Invokes L{setAllowAbsentModule}
        @keyword generate_to_files: Sets L{generateToFiles}
        @keyword uri_content_archive_directory: Invokes L{setUriContentArchiveDirectory}
        @keyword logging_config_file: Invokes L{setLoggingConfigFile}
        t   argvR  R  R  R  R  R  R  R  t   no_load_namespacest   import_augmentable_namespacesR  t   public_namespacest   private_namespacesR  R  t   namespace_module_mapR  R=   R  R  Ry  Rz  t   uri_content_archive_directoryR  N(2   R   R   t   _DEFAULT_bindingRootR  R  t   getcwdR  R  R  R  R  R  R  R  R  Ra   R,   R  t   GetArchivePathR  R4   R  R  R  R  R  R  RD   R  R   R  R  R  R  R  R  R  R  R  t   _Generator__unnamedModulePathst   applyOptionValuest   optionParsert
   parse_argsR|  Rp   R    t   UniqueIdentifiert   _Generator__generationUIDt   XMLt   validateComponentModel(   R   R  R   R  t   _a(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   	  sD    	%	!	. s   \s\s\s+c         C   s   |  j  j d |  S(   NR{  (   t   _Generator__stripSpaces_ret   sub(   R   t   string(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   __stripSpacesJ	  s    R  R  R  t   location_prefix_rewriteR  R  R  R  t   no_load_namespacet   import_augmentable_namespaceR  R  R  R  R  Ry  R  R  c         C   s   xB |  j  D]7 \ } } t | |  } | d  k	 r
 | |  |  q
 q
 Wt | d  } t | d  } |  j | |  | d  k	 r |  j j |  n  t j j j	 |  j
    |  j d  k	 r t j j |  j  n  d  S(   Nt   public_namespacet   private_namespace(   t   _Generator__OptionSetterst   getattrR   R  R  R   Ra   Rp   R    t   SetLocationPrefixRewriteMapR  R  t   loggingt   configt
   fileConfig(   R   t   optionsR  R\   t   methodRs   R
  R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  a	  s    c         C   sK   | d  k r t j d } n  |  j   j |  \ } } |  j | |  |  S(   Ni   (   R   R  R  R  R  R  (   R   R  R)  R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   setFromCommandLineo	  s
    c         C   s   |  j  S(   s:  A unique identifier associated with this Generator instance.

        This is an instance of L{pyxb.utils.utility.UniqueIdentifier}.
        Its associated objects are
        L{pyxb.namespace.archive._SchemaOrigin} instances, which
        identify schema that contribute to the definition of a
        namespace.(   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  v	  s    c         C   s  | s |  j  dO k rt j d d d d t j f d d  } t j | d d  } | j d	 d
 d d d d d |  j |  j	 j
  | j d d d d |  j |  j j
  | j d d d d d d |  j |  j j
  | j d d d d d d |  j |  j j
  | j d d d d |  j |  j j
  | j |  t j | d d  } | j d d d d d d d |  j |  j j
  | j d d d d |  j |  j j
  | j d d d d |  j |  j j
  | j d d  d d! d" d# d |  j |  j j
 d$  | j d% d d& d" d# d |  j |  j j
 d'  | j |  t j | d( d)  } | j d* d d+ d |  j |  j j
  | j d, d d- d d d |  j |  j j
  | j d. d d- d d d |  j |  j j
  | j |  t j | d/ d0  } | j d1 d d2 d |  j |  j j
  | j d3 d d- d d d |  j |  j j
 d4  | j d5 d d- d d d |  j |  j j
 d6  | j d7 d d! d" d8 d |  j |  j j
 d9  | j d: d d& d" d8 d |  j |  j j
 d;  | j |  t j | d< d=  } | j d> d d! d" d? d |  j |  j j
 d@  | j dA d d& d" d? d |  j |  j j
 dB  | j |  t j | dC dD  } | j dE d d2 d |  j |  j j
  | j |  t j | dF dG  } | j dH d d! d" dI d |  j |  j j
 d$  | j dJ d d& d" dI d |  j |  j j
 dK  | j dL d d! d" dM d |  j |  j j
 d$  | j dN d d& d" dM d |  j |  j j
 dK  | j |  | |  _  n  |  j  S(P   s3  Return an C{optparse.OptionParser} instance tied to this configuration.

        @param reset: If C{False} (default), a parser created in a
        previous invocation will be returned.  If C{True}, any
        previous option parser is discarded and a new one created.
        @type reset: C{bool}
        t   usages*   %prog [options] [more schema locations...]t   versions   %%prog from PyXB %st   descriptions+   Generate bindings from a set of XML schemass   Identifying SchemasA   Specify and locate schema for which bindings should be generated.s   --schema-locations   -ut   metavart   FILE_or_URLt   actionR6   t   helps   --schema-roott	   DIRECTORYs   --schema-stripped-prefixt   TEXTR$   R  s   --location-prefix-rewrites   --uri-content-archive-directorys   Configuring Bindingss^   Specify where generated bindings should be written, and how they will be accessed from Python.s   --modules   -mt   MODULEs   --module-prefixs   --binding-roots   -rs   --write-for-customizationt
   store_truet   destR  s"    This option turns on the feature.s   --no-write-for-customizationt   store_falses0    This option turns off the feature (I{default}).s   Reading Namespace Archivess@   Locating and loading (or inhibiting load of) namespace archives.s   --archive-patht   PATHs   --import-augmentable-namespacet   URIs   --no-load-namespaces   Writing Namespace Archivess^   Control the location and content of a namespace archive corresponding to a binding generation.s   --archive-to-filet   FILEs   --public-namespaces;    This option adds the namespace as a public archive member.s   --private-namespaces<    This option adds the namespace as a private archive member.s   --default-namespace-publicR  s6    This option makes the default C{public} (I{default}).s   --default-namespace-privates*    This option makes the default C{private}.s#   Configuring Binding Code Generations   Control the style and content of the generated bindings.  This is not well-supported, and you are advised to pretend these options don't exist.s   --validate-changesR  s+    This option turns on validation (default).s   --no-validate-changess"    This option turns off validation.s   Miscellaneous Optionss   Anything else.s   --logging-config-files   Maintainer Optionss   Don't use these.  They don't exist.  If they did, they'd do different things at different times, and if you used them you'd probably be sorry.s   --allow-absent-moduleRy  s   --no-allow-absent-modules-    This option turns off the feature (default).s   --allow-builtin-generationR  s   --no-allow-builtin-generationN(   t   _Generator__optionParserR   t   optparset   OptionParserRa   R  t   OptionGroupt
   add_optiont   _Generator__stripSpacesR  R   R  R  R  R   t   add_option_groupR  R  R  R  R  R  R  R  R  R  R  R  R  R  (   R   t   resett   parsert   group(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  	  s    	c         C   sV  g  } |  j    } |  j   } xe | r | r | j d  } | j d  } t | t  rg | d } n  | j d | d | g  q! Wx | D] } | j d |  q W|  j   d k	 r | j d |  j    n  |  j	   d k	 r | j d |  j	    n  x1 |  j
   D]# \ } } | j d | | f  qW|  j   d k	 r`| j d |  j    n  | j d |  j    |  j   d k	 r| j d	 |  j    n  x+ |  j   D] } | j d
 | j    qWx+ |  j   D] } | j d | j    qW|  j   d k	 r+| j d |  j    n  xQ |  j   D]C \ } }	 |	 rd| j d | j    q8| j d | j    q8W|  j   r| j d  n | j d  x{ |  j   d f |  j   d f |  j   d f |  j   d f f D]7 \ }
 } |
 r| j d |  q| j d |  qW|  j   d k	 rR| j d |  j    n  | S(   s  Return a command line option sequence that could be used to
        construct an equivalent configuration.

        @note: If you extend the option parser, as is done by
        C{pyxbgen}, this may not be able to reconstruct the correct
        command line.i    s   --schema-location=s	   --module=s   --schema-root=s   --schema-stripped-prefix=%ss   --location-prefix-rewrite=%s=%ss   --module-prefix=s   --binding-root=s   --archive-path=s   --no-load-namespace=s   --import-augmentable-namespace=s   --archive-to-file=s   --public-namespace=s   --private-namespace=s   --default-namespace-publics   --default-namespace-privates   validate-changess   write-for-customizations   allow-absent-modules   allow-builtin-generations   --s   --no-s"   --uri-content-archive-directory=%sN(   R  R  R8  R   R9   R   R6   R  R   R  R  R  R  R  R  R7   R  R  R  R  R  R  R  R  R   (   R   t   optsR  t   schema_listt   mlt   slt   pfxR  R>   R  t   valt   opt(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   getCommandLineArgs	  sZ    c         C   sP   |  j    } | r4 | j |  r4 | t |  } n  t j j j | |  j    S(   N(   R  R0  R   Ra   Rp   R    t   NormalizeLocationR  (   R   RI  t   ssp(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   normalizeSchemaLocation"
  s    c         C   s   | j    d k	 r | S| j   } | j   s| | d k r[ | j   d k	 r[ | j   } n  |  j   j | j   |  } n  | d k r |  j   r t	 j
 j j d |  j  } n  | d k	 r |  j   r d j |  j   | g  } n  | j |  | S(   s  Provide a Python module path for the module record.

        This is the path by which the module bindings associated with
        C{module_record} will be imported.

        If a path had already been assigned to the module, it is left
        in place.

        @param module_record: Information about a collection of related bindings
        @type module_record: L{pyxb.namespace.archive.ModuleRecord}

        @param module_path: Default path to use
        @type module_path: C{str}

        @return: C{module_record}
        t   bindingR  N(   R  R   R,   R1  R7  R  R   R7   R  Ra   Rp   R    R  R  R  R8   t   setModulePath(   R   R%  R  R,   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   assignModulePath(
  s    !c         C   s  |  j  r d  St j j j j |  j    xM |  j   D]? } t | t j j	  sW t
  t j d | f  | j   q6 WxP |  j   D]B } t | t j j	  s t
  t j d | f  | j t  q Wx |  j r|  j j d  } t | t  r| \ } } n d  } ye | d  k rVt j j d |  j |  d |  j   d |  j    } n | |  |  } |  j |  Wq t j k
 r} t j d | j   | j    |  j | j    q Xq Wx |  j D] } t | t  j!  rt j j" | d |  j   } n  | j#   } | d  k	 s#t
  d  } |  j$ rG|  j$ j d  } n  |  j% | j&   |  | j'   | j&   j   k st
  |  j( | j'    qWt |  _  d  |  _) d  |  _* d  S(   Ns    Namespace %s marked not loadables&   Namespace %s marked import-augmentablei    t   absolute_schema_locationt   generation_uidR  s/   Skipped redundant translation of %s defining %s(+   t$   _Generator__didResolveExternalSchemaRa   R,   R  t   NamespaceArchivet   PreLoadArchivesR  R  R   Rf   R!   R   RC  t   markNotLoadableR  t   setImportAugmentableR   R  R8  R9   R   R/   R  t   CreateFromLocationRP  R  R   R}  t   SchemaUniquenessErrort   schemaLocationt   existingSchemaR  R   Ro   RR  t   originRecordR  RS  R  Re  R  t   _Generator__componentGrapht   _Generator__componentOrder(   R   R>   RI  R  R  R  R-  R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   resolveExternalSchemaK
  sP    	!	$		c   	      C   s  | j    } t j j j   } | j    } d   } xd t |  k  r| j   } | d  k	 sf t  | |  s~ | s~ t  | j	   d  k	 s t d t
 |  | f   | j |  | j d t d |  } x | D] } | |  s| st d t
 |  t
 |  f   | j	   d  k rWt | t j j j t j j j f  s t  q n  | j	   j   |  j k r| | k r| j |  | j |  n  | | k r | j | |  q q Wq6 W| S(   Nc         S   s   t  |  t j j  p |  j   S(   N(   R   R/   R0   R   t   isTypeDefinition(   Rh  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   
  s    i    s   %s %s has no originRC  t   include_laxs   %s produced %s in requires(   R  Ra   Rp   R    t   GraphR   R8  R   R!   R,  R$   R  t   bindingRequiresR   R   t	   xmlschemaR0   t
   AnnotationR)   R  t   _Generator__moduleRecordsRL  t   addEdge(	   R   Rc  Rd  t   component_grapht
   need_visitt   bindable_fnRD  t   brR  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   __graphFromComponents
  s,    	.4-'c         C   s#  |  j    d   } t   |  _ t   } xe |  j   j   D]Q } | j   } | |  j k ry |  j j |  | j   n  | j | j	    q; Wt   } xI |  j D]> } | j
   j   r |  j   r q n  | j | j
    q Wt j
 j j |  x' |  j   D] } |  j j | t  qW|  j | t  } t t | | j     } xR | D]J }	 | |	  st d t |	  f   |	 j |	 j   j   j
    qVWg  }
 |  j | t  j   } | d  k rt j d   n  x* | D]" } |
 j t  | d d    qW| |  _! |
 |  _" d  S(   Nc         S   s   t  |  t j j  p |  j   S(   N(   R   R/   R0   R   Rc  (   Rh  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   
  s    s#   Unexpected %s in binding componentss(   Unable to partial-order named componentsR   c         S   s
   |  j    S(   N(   Rg  (   Rh  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   
  s    (#   Rb  R4   Ri  R  t   associatedObjectsR  RL  t   completeGenerationAssociationsR>  t   originatedObjectsR,   R4  R  Ra   t
   resolutiont   ResolveSiblingNamespacesR=   R  R"   R   t   _Generator__graphFromComponentst   filtert   nodesR!   R$   t   _setBindingNamespaceR,  RD   t   rootSetOrderR   R  R   R   R`  Ra  (   R   Rm  t   all_componentsR-  R  R=   R>   Rk  t   binding_componentsRD  t   component_ordert	   root_setst   rs(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   __resolveComponentDependencies
  s>    
			%# 	c         C   s#   |  j  d k r |  j   n  |  j  S(   s  The set of L{pyxb.namespace.archive.ModuleRecord} instances
        associated with schema processed in this generation
        instance.

        These should be in one-to-one correspondence with the
        namespaces for which bindings are being generated.  Multiple
        input schemas may contribute to a single module record; all
        material in that record is placed in a single binding file.
        N(   Ri  R   t(   _Generator__resolveComponentDependencies(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   moduleRecords
  s    
c         C   s#   |  j  d  k r |  j   n  |  j  S(   N(   R`  R   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   componentGraph
  s    c         C   s#   |  j  d  k r |  j   n  |  j  S(   N(   Ra  R   R  (   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   componentOrder
  s    c         C   s  t  j j j   } g  |  j   D] } | j |  ^ q xH |  j   j   D]4 \ } } | j | j	   j
   | j	   j
    qK W| j   } i  } g  } |  j   } x| D]}	 g  }
 x|	 D] } | j | j | j   |  j     |  j |  | j   d  k r0|  j   r0t  j d | f   n  | j   r| j   d  k	 r| j   j d  } d | d f | d <| j d j |   n  t |  | |	  } | | | <|
 j |  q W|
 j d d    | j |
  d t |	  k  r t |  |
  } | j |  x |
 D] } | j  |  qWq q Wg  } g  } x |  j!   D]v } t" | t# j$ j%  r| j&   r| | j	   j
   } | j' |  | j |  qK| j(   rK| j |  qKqKWg  } g  } x'| D]} | | j	   j
   } | d  k	 s1t) d | j*   t+ |  | j,   | j- f   | j' |  } t" | t.  sht) d	 t+ |  f   t" | t# j$ j/  rt0 | |  | |  | j |  qt" | t# j$ j1  rt2 | |  | |  | j |  qt3 st) d
 t+ |  f   qWxD | D]< } t" | t  rx$ | j4   D] } | j5 |  q$WqqWx | D] } t6 | |   qIWx | D] } t7 | |   qgWx | D] } t8 | |   qW| |  _9 d  S(   Ns)   No prefix or module name available for %sR  s   _%siR   c         S   s   |  j    j   S(   N(   R,   R7   (   t   _nm(    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR     s    i   s8   No namespace module for %s type %s scope %s namespace %ss   Unexpected type %ss   Unexpected component type %s(:   Ra   Rp   R    Re  R  t   addRootR  t   edgesRj  R,  R  t   sccOrderR  t   _setIsPublicR   R,   R  RS  R  R   R  R  t   isPublicR   RR  R8   R  R6   Rr  R   R   R  RP  R  R   R/   R0   R   R  Ri  Rc  R!   R   R$   R  R   R  R   R  R  R  RD   R>  RG  R  R  R  t   _Generator__bindingModules(   R   t   module_grapht   _mrt   st   tt   module_scc_ordert   record_binding_mapR  t   nsvmRb  t   scc_modulesR  t   eltsR  t   ngmt   element_declarationst   type_definitionsRD  t   simple_type_definitionst   complex_type_definitionsR   R  t   mR   R   R  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   __generateBindings
  s    &,%
!=(#c         C   s?   |  j  d  k r |  j   n  |  j d  k r8 |  j   n  |  j S(   N(   R`  R   R  R  t   _Generator__generateBindings(   R   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR~  =  s
    c         C   s   |  j    } | d  k	 r t j j j d |  j    } y0 | j t j j	 j
 |   t j d |  Wq t k
 r } t j d |  t | t t t f  r   q q Xn  d  S(   NRU  s   Saved parsed schema to %s URIs(   Failure saving preprocessed schema to %s(   R  R   Ra   R,   R  RW  R  t   writeNamespacesRp   R    R  R   RC  Rq   t	   exceptionR   R!   t   AttributeErrort	   TypeError(   R   t   archive_filet
   ns_archiveR  (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   writeNamespaceArchiveD  s    c         C   s   t  j |  S(   N(   R  R"  (   R   RF   (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR   T  s    N(s   R   R	   R   R  R  R  R   R  RD   R  R  R  Ra  R  R  R  R  R  R  R  R  R  R  R  R  R  R|  R  R  R  R  R}  R  R=   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  t   _Generator__noloadNamespacesR  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R   R  R  R  R  R  R   t   ret   compileR  RA  R#  R  R+  R  R  R  R<  RM  RP  RS  RV  Rb  Ru  R  Ri  R`  Ra  R  R  R  R  R  R~  R  R   (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyR  "  s   				H					
										
																								
														E																				g	8	"	=		.				R		(A   R   R  t   os.pathR  R&  t   logging.configR  R  R  Ra   t   pyxb.xmlschemaRg  R/   t
   pyxb.utilsR    R   R   t   pyxb.utils.utilityR   t   pyxb.bindingR   R   R   t	   getLoggerR   R   R   R   R9  R   R   R(   R@   RH   RK   RO   RR   R   R   R   R   R   R   R   R  R  t   pyxb.utils.facR'  R%  R=  RN  R   R  R  R  R  R  R  R  R  R  R  R=  R  R  (    (    (    sJ   /data/av2000/b2b/venv/lib/python2.7/site-packages/pyxb/binding/generate.pyt   <module>   sl   	
(	F	X			F				`	$	g	o						W ^F