KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/site-packages/ldap/schema/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/site-packages/ldap/schema/subentry.pyc
m
9Dc@sdZdkZdkZdkTdklZeiiZhZxKe	D]@Z
ee
Ze
edoeeei<eiee<nqKWeiZdfdYZddZdS(	s
ldap.schema.subentry -  subschema subentry handling
written by Michael Stroeder <michael@stroeder.com>

See http://python-ldap.sourceforge.net for details.

\$Id: subentry.py,v 1.21 2006/04/10 05:22:19 stroeder Exp $
N(t*(sUserDicttschema_attributet	SubSchemacBstZdZdZddZddZdZdZddZ	ddZ
d	Zd
ZdZ
ddd
dZRS(Nc	Cs!h|_h|_x7tiD])}tii|i|<h|i|<qWtii|}xt
D]}|i|p||oqenxt
d||D]r}t|}||}||i||i<t|do/x,|iD]}|i|i||<qWqqWqeWdS(s[
      sub_schema_sub_entry
          Dictionary containing the sub schema sub entry
      tnamesN(tselftname2oidtsedtSCHEMA_CLASS_MAPPINGtvaluestctldaptcidicttsub_schema_sub_entrytetSCHEMA_ATTRSt	attr_typethas_keytfiltertNonet
attr_valuetse_classtse_instancetget_idthasattrRtname(	RRR	R
RRRRR((t:/usr/lib64/python2.4/site-packages/ldap/schema/subentry.pyt__init__s,		


'cCsh}x|iiD]p}xg|i|iD]R}t|}y|t	|i
|Wq0tj
o|g|t	|<q0Xq0WqW|S(sB
    Returns a dictionary containing the sub schema sub entry
    N(tentryRRtkeysRRtsetstrtse_strtSCHEMA_ATTR_MAPPINGtappendtKeyError(RRRRR((Rt
ldap_entry:sc	Cs|i|}|og}x|iD]h}||}xU|D]M\}}y+t|||jo|i|nWq>t
j
oq>Xq>Wq'Wn
|i}|S(sf
    Returns a list of OIDs of all available schema
    elements of a given schema element class.
    N(RRtschema_element_classtavail_setschema_element_filterstresultRtse_keyRtfktfvtgetattrR!tAttributeError(	RR$R&R*R(R%R'R)R((RtlistallKs 


cCs)|ttgjpt|i||}d}t	i
i
h|g<}x|D]}
g||
<qTWx|D]}|i||d}	|	i|joqon|	i|jptd||i|	ifxP|	ipdD]>}|i|i||}y||i|WqqXqWqoW|S(sm
    Returns a ldap.cidict.cidict dictionary representing the
    tree structure of the schema elements.
    t_s>Schema element referenced by %s must be of class %s but was %sN(R.(R$tObjectClasst
AttributeTypetAssertionErrorRR-R&R%ttop_nodeR
RttreeRtse_oidtget_objRtse_objt	__class__t__name__tsuptsRtgettsup_oidR!(RR$R&R4R3R<R2R:R%R6R((RR3`s,-cCs0|iddi}|i|i||S(s#
    Get an OID by name or OID
    t;iN(t	nameoroidtsplittstripR4RRRR;(RRR>R4((RtgetoidscCs|i||i||}yt||}Wnt	j
o
d}nX|djo*|io |i||id|}n|S(s
    Get a possibly inherited attribute specified by name
    of a schema element specified by nameoroid.
    Returns None if class attribute is not set at all.
    
    Raises KeyError if no schema element is found by nameoroid.
    iN(
RRRRAR>RR+RR'R,RR9tget_inheritedattr(RRR>RR'R((RRBs cCs#|i|i|i|||S(s-
    Get a schema element by name or OID
    N(RRRR;RAR>tdefault(RRR>RC((RR5scCsdk}|pg}|i|i|i|i||}|oDt	|do4x1|D]%}t|||i|||q_Wn|S(st
    Get a schema element by name or OID with all class attributes
    set including inherited class attributes
    NR9(
tcopyt	inheritedRRRR;RAR>RRtclass_attr_nametsetattrRB(RRR>RERFRDR((Rtget_inheritedobjs	
+'cCsM|it|}y|it|}Wntj
odSn	X|i	SdS(sF
    Get the syntax of an attribute type specified by name or OID
    N(
RRAR0R>tat_oidRHtat_objR"Rtsyntax(RR>RJRI((Rt
get_syntaxs	c
Cs|itddgfg}h}xK|D]C}|it|d}|o!|i
djod||i<q+q+Wd}	|i
}xT|oL|i}x9||D]'}|i|it|oPqqW|}	qW|	S(so
    Returns OID of structural object class in object_class_list
    if any is present. Returns None else.
    tkindiN(RR3R/toc_treet
struct_ocstoc_listtoc_nameoroidR5Rtoc_seRMtoidR'Rtstruct_oc_listtpopt	child_oidRRA(
RRPRQRRRTRSRVRORNR'((Rtget_structural_ocs&	cCsD|it|}|o|iSn|itddgfgSdS(s
    Return a list of the applicable AUXILIARY object classes
    for a STRUCTURAL object class specified by 'nameoroid'
    if the object class is governed by a DIT content rule.
    If there's no DIT content rule all available AUXILIARY
    object classes are returned.
    RMiN(RR5tDITContentRuleR>tcontent_ruletauxR-R/(RR>RY((Rtget_applicable_aux_classess
iicCstii}
tii}g}|D] }||i|i	||q#~}h}tiitii}}d|jo/x,|i|
iD]}	|	||	i<qWnx|o|id}|i|oqnd||<y|i||}Wn$tj
o|oqqnXt||ptt|dptt|t|dptt|xt|iD]i}y(|i|
|i|
i	||}	Wn+tj
o|oqd||<qX|	||	i<qWxt|i D]i}y(|i|
|i|
i	||}	Wn+tj
o|oqdd||<qX|	||	i<qW|i!g}|i"D] }||i|i	||q|~qWx/|i#D]!}|i|o||=qqW|p|i%|}
|
o|i't(|
}|oxt|iD]i}y(|i|
|i|
i	||}	Wn+tj
o|oqd||<qX|	||	i<qWxt|i D]i}y(|i|
|i|
i	||}	Wn+tj
o|oqd||<qX|	||	i<qWx|i*D]}|i|
i	||}|i|py|i|
|}	Wn!tj
o|oqqXy||	i=Wntj
onXy||	i=Wqtj
oqXqqWqqn|ox||gD]}x|i#D]}x|D]y\}}y|i|
|}Wn3tj
o'|otd|n||=PqXt1|||jo||=PqqWqWqWn||fS(s}
    Returns a 2-tuple of all must and may attributes including
    all inherited attributes of superior object classes
    by walking up classes along the SUP attribute.

    The attributes are stored in a ldap.cidict.cidict dictionary.

    object_class_list
        list of strings specifying object class names or OIDs
    attr_type_filter
        list of 2-tuples containing lists of class attributes
        which has to be matched
    raise_keyerror
        All KeyError exceptions for non-existent schema elements
	are ignored
    ignore_dit_content_rule
	A DIT content rule governing the structural object class
	is ignored
    s1.3.6.1.4.1.1466.101.120.111itmusttmays0No attribute type found in sub schema by name %sN(2R
tschemaR0R/t_[1]tobject_class_listtoRRR;tobject_class_oidst	oid_cacheRtr_musttr_mayRRRJRSRUtobject_class_oidRRtobject_classR"traise_keyerrort
isinstanceR1Rt
ValueErrorR\taR]textendR9Rtignore_dit_content_ruleRWt
structural_ocR5RXtdit_content_ruletnotsta_oidtattr_type_filtertltafktafvtschema_attr_typeR+(RR`RrRhRmRaRgRtR/RJR0RuRoRnRqRdRfRkRsRcR_ReRvRb((Rtattribute_typess4

  
(
(C

(
(


(R8t
__module__RR#RR-R3RARBR5RHRLRWR[Rw(((RRs		 			
		ic
Cs|i}|idp |idp|idodk}|i|}	ti|	i|}ti|_|i
dd|i|	i}|djo
d}n9|	idjo
t}n
|	i}|i|d|}|i~nTdk}dk}|i|}
|i|
dd}|i|id	\}}|djoti i!|}nd}||fS(
s
  Fetches a parsed schema entry by uri.
  
  If uri is a LDAP URL the LDAP server is queried directly.
  Otherwise uri is assumed to point to a LDIF file which
  is loaded with urllib.
  sldap:sldaps:sldapi:Nttattrstmax_entriesii(#turiR@t
startswithtldapurltLDAPUrltldap_urlR
t
initializet
initializeUrlttrace_levelRstVERSION3tprotocol_versiont
simple_bind_stsearch_subschemasubentry_stdntsubschemasubentry_dnRtsubschemasubentry_entryRzRtschema_attrstread_subschemasubentry_stunbind_sturllibtldifturlopent	ldif_filetLDIFRecordListtldif_parsertparsetall_recordsR^Rtparsed_sub_schema(
R|RRRR~RRsRRRRRR((Rturlfetchs40	


	


(t__doc__tldap.cidictR
tldap.schematldap.schema.modelstUserDictRRR tdirt_nametevalRaRRRRRR(	RRR
RRaRRR R((Rt?s


g

Anon7 - 2021