Ñò v~e2fd?„ƒYZ3d@Z4dAefdB„ƒYZ5dCefdD„ƒYZ6dEefdF„ƒYZ7dGefdH„ƒYZ8dIe2fdJ„ƒYZ9dS(KsThe pkg.config module provides a set of classes for managing both 'flat' (single-level) and 'structured' (n-level deep) configuration data that may be stored in memory, on disk, or using an smf(5) service instance. The basic structure of the classes found here is roughly as follows: Configuration Class (e.g. Config) Provides storage and retrieval of property sections and properties via its child property sections. Section Class (e.g. PropertySection) Provides storage and retrieval of property data via its child properties. Property Class Provides storage and retrieval of property data. Generally, consumers should only need to consume the interfaces provided by the Config class or its subclasses. However, any public method or property of the property sections or property objects can be used as well if advanced access or manipulation of configuration data is needed. iÿÿÿÿN(tmisctportablet ConfigErrorcBseZdZRS(s)Base exception class for property errors.(t__name__t __module__t__doc__(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRCstPropertyConfigErrorcBseZdZddd„ZRS(s)Base exception class for property errors.cCsGtii|ƒ|dj p|dj pt‚||_||_dS(N(t api_errorst ApiExceptiont__init__tNonetAssertionErrortsectiontprop(tselfR R ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR Js! N(RRRR R (((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRGstInvalidPropertyNameErrorcBs eZdZd„Zd„ZRS(s:Exception class used to indicate an invalid property name.cCs+|dj pt‚ti|d|ƒdS(NR (R R RR (RR ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR TscCstdƒ|iS(Ns¬Property name '%s' is not valid. Section names may not contain: tabs, newlines, carriage returns, form feeds, vertical tabs, slashes, backslashes, or non-ASCII characters.(t_R (R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt__str__Xs (RRRR R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRQs t InvalidPropertyTemplateNameErrorcBs eZdZd„Zd„ZRS(sLException class used to indicate an invalid property template name. cCs+|dj pt‚ti|d|ƒdS(NR (R R RR (RR ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR cscCstdƒ|iS(Ns)Property template name '%s' is not valid.(RR (R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRgs (RRRR R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR_s tInvalidPropertyValueErrorcBs/eZdZdddddd„Zd„ZRS(s;Exception class used to indicate an invalid property value.cCsZti|d|d|ƒ|dj o |dj pt‚||_||_||_dS(NR R (RR R R tmaximumtminimumtvalue(RRRR R R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR os "  cCsq|idj otdƒ|iS|idj otdƒ|iS|iotdƒ|iStdƒ|iS(Nsq'%(value)s' is less than the minimum of '%(minimum)s' permitted for property '%(prop)s' in section '%(section)s'.st'%(value)s' is greater than the maximum of '%(maximum)s' permitted for property '%(prop)s' in section '%(section)s'.sKInvalid value '%(value)s' for property '%(prop)s' in section '%(section)s'.s'Invalid value '%(value)s' for %(prop)s.(RR Rt__dict__RR (R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRws        N(RRRR R R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRls  tPropertyMultiValueErrorcBseZdZd„ZRS(s`Exception class used to indicate the property in question doesn't allow multiple values.cCs-|iotdƒ|iStdƒ|iS(NsKProperty '%(prop)s' in section '%(section)s' doesn't allow multiple values.s*Property %s doesn't allow multiple values.(R RRR (R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRŽs     (RRRR(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRŠstUnknownPropertyValueErrorcBs)eZdZdddd„Zd„ZRS(svException class used to indicate that the value specified could not be found in the property's list of values.cCs&ti|d|d|ƒ||_dS(NR R (RR R(RR R R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR šscCs-|iotdƒ|iStdƒ|iS(NscValue '%(value)s' not found in the list of values for property '%(prop)s' in section '%(section)s'.s@Value '%(value)s' not found in the list of values for %(prop)s .(R RR(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRžs     N(RRRR R R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR–stInvalidSectionNameErrorcBs eZdZd„Zd„ZRS(s9Exception class used to indicate an invalid section name.cCs+|dj pt‚ti|d|ƒdS(NR (R R RR (RR ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR ªscCstdƒ|iS(Ns«Section name '%s' is not valid. Section names may not contain: tabs, newlines, carriage returns, form feeds, vertical tabs, slashes, backslashes, or non-ASCII characters.(RR (R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR®s (RRRR R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR§s tInvalidSectionTemplateNameErrorcBs eZdZd„Zd„ZRS(sBException class used to indicate an invalid section template name.cCs+|dj pt‚ti|d|ƒdS(NR (R R RR (RR ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR ¸scCstdƒ|iS(Ns(Section template name '%s' is not valid.(RR (R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR¼s (RRRR R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRµs tUnknownPropertyErrorcBseZdZd„ZRS(s5Exception class used to indicate an invalid property.cCs-|iotdƒ|iStdƒ|iS(Ns5Unknown property '%(prop)s' in section '%(section)s'.sUnknown property %s(R RRR (R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÄs   (RRRR(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÁstUnknownSectionErrorcBseZdZd„ZRS(s4Exception class used to indicate an invalid section.cCstdƒ|iS(NsUnknown property section: %s.(RR (R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÎs(RRRR(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRËstPropertycBs¶eZdZeidƒZdZei Z dei d„Z d„Z d„Z d„Zd„Zd„Zd „Zd „Zd „Zed „ƒZed „ƒZeid„ƒZRS(sBase class for properties.s\A[^\t\n\r\f\v\\/]+\ZtcCst|tƒ p|ii|ƒ otd|ƒ‚ny|idƒWn"tj otd|ƒ‚nX||_||_||_ dS(NR tascii( t isinstancet basestringt_Property__name_retmatchRtencodet ValueErrort_Property__nameRt _value_map(Rtnametdefaultt value_map((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR Ûs  cCs(t|tƒpdSt|i|iƒS(Niÿÿÿÿ(R!RtcmpR)(Rtother((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt__cmp__êscCs=t|tƒptS|i|ijotS|i|ijS(N(R!RtFalseR)R(RR-((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt__eq__ïs cCs=t|tƒptS|i|ijotS|i|ijS(N(R!RtTrueR)R(RR-((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt__ne__ös cCs"|i|id|id|iƒS(NR*R+(t __class__R)RR((R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt__copy__ýscCs.t|itƒo|iSt|iƒdƒS(Nsutf-8(R!RtunicodeR(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt __unicode__scCs1t|itƒo|iidƒSt|iƒS(Nsutf-8(R!RR5R%tstr(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRscCs0t|tƒptd|id|ƒ‚ndS(sqRaises an InvalidPropertyValueError if 'value' is not allowed for this property. R RN(R!R"RR)(RR((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt _is_allowed scCsjt|tƒoVy|idƒ}Wqftj o0y|idƒ}Wqbtj oqbXqfXn|S(NR sutf-8(R!R7R%R&tdecode(RR((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt_transform_stringscCs|iS(sThe name of the property.(R'(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR)%scCs|iS(sThe value of the property.(t_value(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR*scCst|tƒo|ii||ƒ}n|djo d}n6t|ttfƒot|ƒ}n|i|ƒ}|i |ƒ||_ dS(sSets the property's value.RN( R!R"R(tgetR tbooltintR7R:R8R;(RR((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR/s   N(RRRtretcompileR#R R;Rt EmptyDictR(R R.R0R2R4R6RR8R:tpropertyR)Rtsetter(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÒs         tPropertyTemplatecBsMeZdZddedd„Zd„Zd„Zd„Ze d„ƒZ RS(s!A class representing a template for a property. These templates are used when loading existing configuration data or when adding new properties to an existing configuration object if the property name found matches the pattern name given for the template. cCs¦|pt‚t|tƒ p| otd|ƒ‚n||_yti|ƒ|_Wn"tj otd|ƒ‚nX||_ ||_ ||_ ||_ dS(NR ( R R!R"Rt_PropertyTemplate__nameR?R@t_PropertyTemplate__patternt Exceptiont_PropertyTemplate__allowedt_PropertyTemplate__defaultt_PropertyTemplate__prop_typet_PropertyTemplate__value_map(Rt name_patterntallowedR*t prop_typeR+((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR Es     c Cs4|i|id|id|id|id|iƒS(NRMR*RNR+(R3RERHRIRJRK(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR4ZscCs|i|ƒpt‚h}|idj o|i|ds   tPropBoolcBs5eZdZeeid„Zeii d„ƒZRS(s3Class representing properties with a boolean value.cCs ti||d|d|ƒdS(NR*R+(RR (RR)R*R+((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR }scCsát|tƒo|ii||ƒ}n|djp |djot|_dSt|tƒoF|iƒdjot|_dS|iƒdjot|_dSnt|t ƒo||_dSt d|i d|ƒ‚dS(NRttruetfalseR R( R!R"R(R<R R/R;tlowerR1R=RR)(RR((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRs      ( RRRR/RRAR RRRC(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRQzstPropIntcBsbeZdZdddeid„Zd„Zed„ƒZ ed„ƒZ e i i d„ƒZ RS(s4Class representing a property with an integer value.icCs€|djpt|ƒtjpt‚|djpt|ƒtjpt‚||_||_ti||d|d|ƒdS(NR*R+(R ttypeR>R t_PropInt__maximumt_PropInt__minimumRR (RR)R*RRR+((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR ˜s ''  cCs+ti|ƒ}|i|_|i|_|S(N(RR4RWRX(RR ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR4¡s  cCs|iS(s2Minimum value permitted for this property or None.(RX(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR§scCs|iS(s2Maximum value permitted for this property or None.(RW(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR¬sc Cs"t|tƒo|ii||ƒ}n|djp |djo d}nyt|ƒ}Wn+tj otd|id|ƒ‚nX|i dj o5||i jo%td|id|i d|ƒ‚n|i dj o5||i jo%td|id|i d|ƒ‚n||_ dS(NRiR RRR( R!R"R(R<R R>RGRR)RRR;(RRtnvalue((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR±s    N(RRRR RRAR R4RBRRRRRC(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRU•s t PropPublishercBs#eZdZeiid„ƒZRS(sBClass representing properties with a publisher prefix/alias value.cCsœt|tƒo|ii||ƒ}n|djp |djod|_dSt|tƒ pti|ƒ otd|i d|ƒ‚n||_dS(NRR R( R!R"R(R<R R;Rtvalid_pub_prefixRR)(RR((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÊs  (RRRRRRC(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRZÇst PropDefinedcBsGeZdZeideid„Zd„Zd„Ze d„ƒZ RS(saClass representing properties with that can only have one of a set of pre-defined values.RcCs)||_ti||d|d|ƒdS(NR*R+(t_PropDefined__allowedRR (RR)RMR*R+((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR Þs cCs(ti|ƒ}ti|iƒ|_|S(N(RR4tcopyR](RR ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR4äscCs!ti||ƒt|iƒdjodSxï|iD]Ì}||joPn|djo(|idƒot|ƒdjoPn|djo(|idƒot|ƒdjoPn|d jotii|ƒoPn|d jot|ƒd joPq5q5Wtd |i d |ƒ‚dS(sqRaises an InvalidPropertyValueError if 'value' is not allowed for this property. iNssexec:is ssvc:is s iR R( RR8tlenR]t startswithtostpathtisabsRR)(RRta((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR8és(      cCs|iS(s+A list of allowed values for this property.(R](R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRM s( RRRRtEmptyIRAR R4R8RBRM(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR\Ús    #tPropListcBs,eZdZd„Zeiid„ƒZRS(svClass representing properties with a list of string values that may contain arbitrary character data. cCsKyti|ƒ}Wn1ttfj otd|id|ƒ‚nX|S(saParse the provided python string literal and return the resulting data structure.R R(tastt literal_evalt SyntaxErrorR&RR)(RR((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt _parse_strs c CsÃt|tƒo|ii||ƒ}n|djp |djo g}nŒt|tƒo?|i|ƒ}t|tƒptd|id|ƒ‚qØn=yt |ƒWn+t j otd|id|ƒ‚nXg}x‘|D]‰}|djo d}nSt|t t fƒot |ƒ}n-t|tƒptd|id|ƒ‚n|i|ƒ|i|ƒqåW|io:d|ijo*t|ƒ otd|id|ƒ‚n||_dS(NRR R(R!R"R(R<R RjtlistRR)titert TypeErrorR=R>R7R8tappendRMR_R;(RRRYtv((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR"s<     ( (RRRRjR\RRC(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRfs tPropDictionaryListcBs,eZdZeiid„ƒZd„ZRS(sÄClass representing properties with a value specified as a list of dictionaries. Each dictionary must contain string key/value pairs, or a string key, with None as a value. c CsÇt|tƒo|ii||ƒ}n|djp |djo g}nŒt|tƒo?|i|ƒ}t|tƒptd|id|ƒ‚qØn=yt |ƒWn+t j otd|id|ƒ‚nX|i |ƒg}xˆ|D]€}|djo h}n-t|t ƒptd|id|ƒ‚nx'|D]}||pd||eZdZdeid„Zd„Zeii d„ƒZRS(sTClass representing a property with a non-negative integer dotsequence value.t0cCs ti||d|d|ƒdS(NR*R+(RR (RR)R*R+((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR CscCs |iiƒS(N(Rtget_short_version(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRGscCsÁt|tƒo|ii||ƒ}n|djp |djo d}nt|tiiƒo |}nHytii|dƒ}Wn+tj ot d|i d|ƒ‚nX||_ dS(NRR‰s5.11R R( R!R"R(R<R tpkgtversiontVersionRGRR)R;(RRRY((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRJs  ( RRRRRAR RRRRC(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRˆ?s tPropertySectioncBsŒeZdZeidƒZeid„Zd„Z d„Z d„Z d„Z d„Z d„Zd „Zd „Zd „Zed „ƒZRS( s¤A class representing a section of the configuration that also provides an interface for adding and managing properties and sections for the section.s\A[^\t\n\r\f\v\\/]+\ZcCs›t|tƒ p!|ii|ƒ p |djot|ƒ‚ny|idƒWntj ot|ƒ‚nX||_td„|Dƒƒ|_ dS(Nt CONFIGURATIONR css"x|]}|i|fVqWdS(N(R)(t.0tp((s0/usr/lib/python2.6/vendor-packages/pkg/config.pys us ( R!R"t_PropertySection__name_reR$RR%R&t_PropertySection__nameRqt_PropertySection__properties(RR)t properties((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR hs  cCs(t|tƒpdSt|i|iƒS(Niÿÿÿÿ(R!RŽR,R)(RR-((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR.wscCsC|i|iƒ}x*|iƒD]}|iti|ƒƒqW|S(N(R3R“tget_propertiest add_propertyR^(RtpropsecR‘((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR4|s  cCs t|iƒS(N(R5R)(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR6‚scCs|iS(N(R)(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR…scCs.|i|ijpt‚||i|i<|S(shAdds the specified property object to the section. The property must not already exist.(R)R”R (RR ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR—ˆscCstd„|iiƒDƒƒS(sQReturns a dictionary of property values indexed by property name.css(x!|]\}}||ifVqWdS(N(R(RtpnameR‘((s0/usr/lib/python2.6/vendor-packages/pkg/config.pys “s (RqR”t iteritems(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt get_indexscCsAy|i|SWn+tj otd|id|ƒ‚nXdS(s{Returns the property object with the specified name. If not found, an UnknownPropertyError will be raised.R R N(R”tKeyErrorRR“(RR)((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt get_property—s cCs |iiƒS(sNReturns a generator that yields the list of property objects. (R”t itervalues(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR– scCs@y|i|=Wn+tj otd|id|ƒ‚nXdS(s6Removes any matching property object from the section.R R N(R”RœRR“(RR)((s0/usr/lib/python2.6/vendor-packages/pkg/config.pytremove_property¥s cCs|iS(sThe name of the section.(R“(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR)­s(RRRR?R@R’RReR R.R4R6RR—R›RR–RŸRBR)(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRŽ]s        tPropertySectionTemplatecBsGeZdZeid„Zd„Zd„Zd„Ze d„ƒZ RS(s1A class representing a template for a section of the configuration. These templates are used when loading existing configuration data or when adding new sections to an existing configuration object if the section name found matches the pattern name given for the template. cCs}t|tƒ p| otd|ƒ‚n||_yti|ƒ|_Wn"tj otd|ƒ‚nX||_dS(NR ( R!R"Rt_PropertySectionTemplate__nameR?R@t!_PropertySectionTemplate__patternRGt$_PropertySectionTemplate__properties(RRLR•((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR ºs  cCs"|i|idti|iƒƒS(NR•(R3R¡R^R£(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR4ÉscCsN|i|ƒpt‚t|dg}|iD]}|ti|ƒq.~ƒS(sqReturns a new PropertySection object based on the template using the given name. R•(R$R RŽR£R^(RR)R|R‘((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRPÍs cCs|ii|ƒdj S(s{Returns a boolean indicating whether the given name matches the pattern for this template. N(R¢R$R (RR)((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR$ÙscCs|iS(s9The name (pattern text) of the property section template.(R¡(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR)ßs( RRRRReR R4RPR$RBR)(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR ³s   tConfigcBs(eZdZeZdZeieidd„Z d„Z d„Z e d„Z d„Zd„Ze d„Zd„Zeid „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zeid„Zd„Zd„Ze d„ƒZ!e d„ƒZ"d„Z#RS(sSThe Config class provides basic in-memory management of configuration data.cCs‡|djpt|tƒpt‚h|_||_|djo'|ot|iƒƒ}qjd}n||_|i d|ƒdS(sþInitializes a Config object. 'definitions' is a dictionary of PropertySection objects indexed by configuration version defining the initial set of property sections, properties, and values for a Config object. 'overrides' is an optional dictionary of property values indexed by section name and property name. If provided, it will be used to override any default values initially assigned during initialization. 'version' is an integer value that will be used to determine which configuration definition to use. If not provided, the newest version found in 'definitions' will be used. it overridesN( R R!R>R t_Config__sectionst_defstmaxtkeyst_versiontreset(Rt definitionsR¥RŒ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR ís$     cCspd}xc|iƒD]U\}}|d|i7}x+|D]#}|d|it|ƒf7}q7W|d7}qW|S(seReturns a unicode object representation of the configuration object. us[%s] u%s = %s s (R–R)R5(RtouttsectpropsR‘((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR6 s !cCspd}xc|iƒD]U\}}|d|i7}x+|D]#}|d|it|ƒf7}q7W|d7}qW|S(s]Returns a string representation of the configuration object. Rs[%s] s%s = %s s (R–R)R7(RR­R®R¯R‘((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRs !c Cs|i|ƒ|i|ƒy|i|ƒ}Wn}tj oq|i|ƒ}g}|iƒD]$}t|tƒp||iq^q^~}t |i |ƒ|i |ƒnXy|i |ƒSWnKt j o?|i|iƒ}|i||d|ƒ} |i| ƒ| SXdS(s§Returns the Property object matching the given name for the given PropertySection object, or adds a new one (if it does not already exist) based on class definitions. 'default_type' is an optional parameter specifying the type of property to create if a class definition does not exist for the given property. t default_typeN(t_validate_section_namet_validate_property_namet get_sectionRt_Config__get_section_defR–R!RR)tmapRŸt add_sectionRRt_Config__get_property_defR—( RR R)R°tsecobjR|R‘telidetsecdeftpropobj((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt_get_matching_property#s$  '  cCsdS(sbRaises an exception if property name is not valid for this class. N((RR)((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR²NscCsdS(saRaises an exception if section name is not valid for this class. N((RR)((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR±TscCsy |i|ƒ}ti|ƒSWnftj oZxI|iƒD];}t|tƒpq>n|i|ƒo|i|ƒSq>W||ƒSXdS(s|Returns a new Property object for the given name based on class definitions (if available). N(RR^RR–R!RDR$RP(RRºR)R°R»R‘((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt__get_property_defZs cCsÀx³|ii|itiƒD];}t|tƒpqn|i|joti|ƒSqWxX|ii|itiƒD];}t|t ƒpqwn|i |ƒo|i |ƒSqwWt|ƒS(sƒReturns a new PropertySection object for the given name based on class definitions (if available). ( R§R<RªRRAR!RŽR)R^R R$RP(RR)ts((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt__get_section_defps  c Csh|_x´|ii|itiƒD]—}t|tƒpq%n|i|i ƒt i |ƒ}g}|i ƒD]$}t|t ƒp||i qrqr~}t |i|ƒ|i|ƒq%WxJ|iƒD]<\}}x-|iƒD]\} } |i|| | ƒqæWqÍWdS(s6Returns the configuration object to its default state.N(R¦R§R<RªRRAR!RŽR±R)R^R–RRµRŸR¶Ršt set_property( RR¥R¾R¸R|R‘R¹tsnameR¯R™Rv((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt__resetŠs  '  cCsÆ|i||dtƒ}t|itƒptd|d|d|ƒ‚nti|iƒ}|i|ƒy ||_Wn@tj o4}t |dƒo|i o ||_ n‚nXt |_ dS(sKAdds the value to the property object matching the given section and name. If the section or property does not already exist, it will be added. Raises InvalidPropertyValueError if the value is not valid for the given property or if the target property isn't a list.R°R R RN( R¼RfR!RRkRR^RnRthasattrR R1t_dirty(RR R)RR»tpvalte((s0/usr/lib/python2.6/vendor-packages/pkg/config.pytadd_property_value s     cCsUt|tƒpt‚|i|ijpt‚|i|iƒ||i|iÊs (Rqt get_sections(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR›ÆscCsNy|i|ƒ}Wn(tj otd|d|ƒ‚nX|i|ƒiS(sÖReturns the value of the property object matching the given section and name. Raises UnknownPropertyError if it does not exist. Be aware that references to the original value are returned; if the return value is not an immutable object (such as a list), changes to the object will affect the property. If the return value needs to be modified, consumers are advised to create a copy first, and then call set_property() to update the value. Calling set_property() with the updated value is the only way to ensure that changes to a property's value are persistent. R R (R³RRRR(RR R)R®((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÎs cCsd„|iƒDƒS(sàReturns a generator that yields a list of tuples of the form (section object, property generator). The property generator yields the list of property objects for the section. css%x|]}||iƒfVqWdS(N(R–(RR¾((s0/usr/lib/python2.6/vendor-packages/pkg/config.pys ês (RÈ(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR–äscCs8y|i|SWn"tj otd|ƒ‚nXdS(s‰Returns the PropertySection object with the given name. Raises UnknownSectionError if it does not exist. R N(R¦RœR(RR)((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR³îscCs |iiƒS(sUReturns a generator that yields the list of property section objects.(R¦Rž(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÈ÷scCsXy|i|ƒ}Wn(tj otd|d|ƒ‚nX|i|ƒt|_dS(s“Remove the property object matching the given section and name. Raises UnknownPropertyError if it does not exist. R R N(R³RRRŸR1RÄ(RR R)R®((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRŸüs  c CsJ|i|ƒ|i|ƒy|i|ƒ}Wn(tj otd|d|ƒ‚nX|i|ƒ}t|itƒpt d|d|d|ƒ‚nt i |iƒ}y|i |ƒWn.t j o"t d|d|d|ƒ‚nRXy ||_Wn@tj o4}t|dƒo|i o ||_n‚nXt|_dS(syRemoves the value from the list of values for the property object matching the given section and name. Raises UnknownPropertyError if the property or section does not exist. Raises InvalidPropertyValueError if the value is not valid for the given property or if the target property isn't a list.R R RN(R±R²R³RRRR!RRkRR^tremoveR&RRRÃR R1RÄ(RR R)RR¸R»RÅRÆ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pytremove_property_value s.      cCs@y|i|=Wn"tj otd|ƒ‚nXt|_dS(s…Remove the object matching the given section name. Raises UnknownSectionError if it does not exist. R N(R¦RœRR1RÄ(RR)((s0/usr/lib/python2.6/vendor-packages/pkg/config.pytremove_section3s cCst|_|id|ƒdS(s‚Discards current configuration data and returns the configuration object to its initial state. 'overrides' is an optional dictionary of property values indexed by section name and property name. If provided, it will be used to override any default values initially assigned during reset. R¥N(R1RÄt_Config__reset(RR¥((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR«=s cCs‰|i|ƒ|i|ƒ|i||ƒ}y ||_Wn@tj o4}t|dƒo|i o ||_n‚nXt|_dS(sSets the value of the property object matching the given section and name. If the section or property does not already exist, it will be added. Raises InvalidPropertyValueError if the value is not valid for the given property.R N( R±R²R¼RRRÃR R1RÄ(RR R)RR»RÆ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÀKs    cCsQxJ|iƒD]<\}}x-|iƒD]\}}|i|||ƒq&Wq WdS(s}Sets the values of the property objects matching those found in the provided dictionary. If any section or property does not already exist, it will be added. An InvalidPropertyValueError will be raised if the value is not valid for the given properties. 'properties' should be a dictionary of dictionaries indexed by section and then by property name. As an example: { 'section': { 'property': value } } N(RšRÀ(RR•R R¯R™RÅ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pytset_properties]s   cCs|iS(s¨Returns the target used for storage and retrieval of configuration data. This can be None, a pathname, or an SMF FMRI. (t_target(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyttargetrscCs|iS(scReturns an integer value used to indicate what set of configuration data is in use.(Rª(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRŒzscCsdS(sqSaves the current configuration object to the target provided at initialization. N((R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pytwritesN($RRRR/RÄR RÎRRAR R6RRR¼R²R±R·R´RÌRÇR¶R›RR–R³RÈRŸRÊRËR«RÀRÍRBRÏRŒRÐ(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR¤æs:   +          )   t FileConfigcBsMeZdZeieidd„Zeid„Zeid„Zd„Z RS(s The FileConfig class provides file-based retrieval and storage of non-structured (one-level deep) configuration data. This particular class uses Python's ConfigParser module for configuration storage and management. ConfigParser uses a simple text format that consists of sections, lead by a "[section]" header, and followed by "name = value" entries, with continuations, etc. in the style of RFC 822. Values can be split over multiple lines by beginning continuation lines with whitespace. A sample configuration file might look like this: [pkg] port = 80 inst_root = /export/repo [pub_example_com] feed_description = example.com's software update log cCs,||_ti|d|d|d|ƒdS(s›Initializes the object. 'pathname' is the name of the file to read existing configuration data from or to write new configuration data to. If the file does not already exist, defaults are set based on the version provided and the file will be created when the configuration is written. 'definitions' is a dictionary of PropertySection objects indexed by configuration version defining the initial set of property sections, properties, and values for a Config object. 'overrides' is an optional dictionary of property values indexed by section name and property name. If provided, it will be used to override any default values initially assigned during initialization. 'version' is an integer value that will be used to determine which configuration definition to use. If not provided, the version will be based on the contents of the configuration file or the newest version found in 'definitions'. R¬R¥RŒN(RÎR¤R (RtpathnameR¬R¥RŒ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR s c Cs/tiƒ}d„|_y"ti|iddddƒ}WnXtj oL}|itijoq |iti jot i |i ƒ‚q ‚nXy|i |ƒWn3titifj o}t i|iƒ‚nXy|iddƒ}||_Wn"tititfj onXti|d|ƒxõ|iƒD]ç}|djoq@nxÊ|i|ƒD]¹\}}||jo|||joqjn|i||ƒ} yt|ƒ}Wntj onXy || _Wqjtj o4}t|d ƒo|i o ||_ n‚qjXqjWq@Wd S( sÙReads the specified pathname and populates the configuration object based on the data contained within. The file is expected to be in a ConfigParser-compatible format. cSs|S(((tx((s0/usr/lib/python2.6/vendor-packages/pkg/config.pytÅstmodetrbtencodingsutf-8RRŒR¥R N(!t ConfigParsertRawConfigParsert optionxformtcodecstopenRÎtEnvironmentErrorterrnotENOENTtEACCESRtPermissionsExceptiontfilenametreadfpt ParsingErrortMissingSectionHeaderErrortInvalidConfigFiletgetintRªtNoSectionErrort NoOptionErrorR&R¤R«tsectionsRsR¼R7tUnicodeEncodeErrorRRRÃR ( RR¥tcptefileRÆRŒR R RR»((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyt__read»s^             cCs(|id|ƒ|p t|_ndS(sƒDiscards current configuration state and returns the configuration object to its initial state. 'overrides' is an optional dictionary of property values indexed by section name and property name. If provided, it will be used to override any default values initially assigned during reset. R¥N(t_FileConfig__readR/RÄ(RR¥((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR«s cCs+tii|iƒo|i odStiƒ}d„|_xˆ|iƒD]z\}}t |t ƒpt ‚|i |i ƒxD|D]<}t |tƒpt ‚|i|i |i t|ƒƒq…WqKW|i dƒ|iddt|iƒƒd}zytii|iƒ}tid|ƒ\}}d}yti|iƒ}Wn/tj o#} | itijo‚qynX|ooti|ti|iƒƒyti||i|i ƒWqtj o#} | iti!jo‚qëqXnti|t"i#ƒti$|dƒi%i&ƒ} zI| ~ } t'i(| dƒi%i&ƒ} z| ~ } |i)| ƒWdQXWdQXti*||iƒt+|_Wnjt,j o^} | iti-jot.i/| i0ƒ‚n*| iti1jot.i2| i0ƒ‚n‚nXWd|o$tii|ƒoti3|ƒnXdS(slSaves the configuration data using the pathname provided at initialization. NcSs|S(((RÓ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÔ(sRRŒtdirtwbsutf-8(4RaRbtexistsRÎRÄRØRÙRÚR–R!RŽR R¶R)RtsetR7RªR tdirnamettempfiletmkstemptstattOSErrorRÞRßtfchmodtS_IMODEtst_modeRtchowntst_uidtst_gidtEPERMRt PKG_FILE_MODEtfdopent__exit__t __enter__RÛt EncodedFileRÐtrenameR/RÝRàRRáRâtEROFStReadOnlyFileSystemExceptiontunlink(RRìR R¯R‘tfnRôtfdtstRÆR|tft_[2]tef((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRÐs`!   '  ))  N( RRRRRAR R RïR«RÐ(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRшs Ls4^([A-Za-z][ A-Za-z0-9.-]*,)?[A-Za-z][ A-Za-z0-9-_]*$tSMFInvalidPropertyNameErrorcBs eZdZd„Zd„ZRS(s>Exception class used to indicate an invalid SMF property name.cCs+|dj pt‚ti|d|ƒdS(NR (R R RR (RR ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR escCstdƒh|id6td6S(NsÐProperty name '%(name)s' is not valid. Property names may not contain: tabs, newlines, carriage returns, form feeds, vertical tabs, slashes, or backslashes and must also match the regular expression: %(exp)sR)texp(RR t _SMF_name_re(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRis (RRRR R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRbs tSMFInvalidSectionNameErrorcBs eZdZd„Zd„ZRS(s=Exception class used to indicate an invalid SMF section name.cCs+|dj pt‚ti|d|ƒdS(NR (R R RR (RR ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR tscCstdƒh|id6td6S(NsÎSection name '%(name)s' is not valid. Section names may not contain: tabs, newlines, carriage returns, form feeds, vertical tabs, slashes, or backslashes and must also match the regular expression: %(exp)sR)R(RR R(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRxs (RRRR R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRqs t SMFReadErrorcBs eZdZd„Zd„ZRS(s~Exception classes used to indicate that an error was encountered while attempting to read configuration data from SMF.cCs8ti|ƒ|o|pt‚||_||_dS(N(RR R tfmriterrmsg(Rtsvc_fmriR((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR „s  cCstdƒ|iS(NsEUnable to read configuration data for SMF FMRI '%(fmri)s': %(errmsg)s(RR(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRŠs (RRRR R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR€s t SMFWriteErrorcBs eZdZd„Zd„ZRS(s}Exception classes used to indicate that an error was encountered while attempting to write configuration data to SMF.cCs8ti|ƒ|o|pt‚||_||_dS(N(RR R RR(RRR((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR “s  cCstdƒ|iS(NsFUnable to write configuration data for SMF FMRI '%(fmri)s': %(errmsg)s(RR(R((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR™s (RRRR R(((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyRs t SMFConfigc BsweZdZeieƒZdZei dei d d „Z d„Z d„Z ei d„Zei d„Zd„ZRS(sThe SMFConfig class provides SMF-based retrieval of non-structured (one-level deep) configuration data. Property groups should be named after property sections. Properties with list-based values should be stored using SMF list properties.tgeneralt restartertfstautofstntptnetworktstartdt manifestfileststarttstopttm_common_nameicCs5||_||_ti|d|d|d|ƒdS(suInitializes the object. 'svc_fmri' is the FMRI of the SMF service to use for property data storage and retrieval. 'definitions' is a dictionary of PropertySection objects indexed by configuration version defining the initial set of property sections, properties, and values for a Config object. 'doorpath' is an optional pathname indicating the location of a door file to be used to communicate with SMF. This is intended for use with an alternative svc.configd daemon. 'overrides' is an optional dictionary of property values indexed by section name and property name. If provided, it will be used to override any default values initially assigned during initialization. 'version' is an integer value that will be used to determine which configuration definition to use. If not provided, the version will be based on the newest version found in 'definitions'. R¬R¥RŒN(t_SMFConfig__doorpathRÎR¤R (RRR¬tdoorpathR¥RŒ((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR ©s  cCs'|ii|ƒpt|ƒ‚ndS(sbRaises an exception if property name is not valid for this class. N(t_SMFConfig__name_reR$R(RR)((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR²ÉscCs8|ii|ƒ p||ijot|ƒ‚ndS(saRaises an exception if section name is not valid for this class. N(R&R$t_SMFConfig__reserved_sectionsR(RR)((s0/usr/lib/python2.6/vendor-packages/pkg/config.pyR±Ðsc Csd}|iod|i}nd||if}ti|ƒ\}}|ot|idtƒƒ‚nh}d}x|idƒD]ð}|djo |}n ||7}ti d|ƒo|d7}q‰n|iddƒ\} } } | id d ƒ\} } | |i jo d}q‰n| d jp | d jo| d jo d} n|i | hƒ| || | /sh                  l<278M>!V3ÿ£Ø