[Subversion] / PEAK / src / peak / config / api_impl.py  

Diff of /PEAK/src/peak/config/api_impl.py

Parent Directory | Revision Log

version 554, Thu Oct 10 23:01:32 2002 UTC version 555, Fri Oct 11 00:53:50 2002 UTC
Line 48 
Line 48 
     """Return a local configuration object for 'forRoot'"""      """Return a local configuration object for 'forRoot'"""
       forRoot = binding.getRootComponent(forRoot)
     if forRoot is not None and _localCfgs.has_key(forRoot):      if forRoot is not None and _localCfgs.has_key(forRoot):
         return _localCfgs[forRoot]          return _localCfgs[forRoot]
Line 78 
Line 80 
 def getProperty(obj, propName, default=NOT_GIVEN):  def getProperty(obj, propName, default=NOT_GIVEN):
     """Find property 'propName' for 'obj'      """Find property 'propName' for 'obj'
Line 95 
Line 95 
     if not isinstance(propName,Property):      if not isinstance(propName,Property):
         propName = Property(propName)          propName = Property(propName)
     if propName.isWildcard():      if not propName.isPlain():
         raise exceptions.InvalidName(          raise exceptions.InvalidName(
             "getProperty() can't use wildcard properties", propName              "getProperty() can't use wildcard/default properties", propName
         )          )
     for c in binding.iterParents(obj):      prop = binding.findUtility(obj, propName, NOT_FOUND)
         prop = c._getUtility(propName, obj)  
         if prop is not NOT_FOUND:          if prop is not NOT_FOUND:
             return prop              return prop
         pm = c._getUtility(IPropertyMap, obj)  
         if pm is not NOT_FOUND:  
             prop = pm.getPropertyFor(obj,propName)  
             if prop is not NOT_FOUND:  
                 return prop  
         if default is NOT_GIVEN:          if default is NOT_GIVEN:
             raise exceptions.PropertyNotFound(propName, obj)              raise exceptions.PropertyNotFound(propName, obj)
         return default          return default
 def registerGlobalProvider(ifaces, provider):  def registerGlobalProvider(ifaces, provider):
     getGlobal().registerProvider(ifaces, provider)      getGlobal().registerProvider(ifaces, provider)
Line 128 
Line 128 
 def setGlobalProperty(propName, value):  def setGlobalProperty(propName, value):
     pm = binding.findUtility(getGlobal(), IPropertyMap)      pm = binding.findUtility(getGlobal(), IPropertyMap)
     pm.setPropertyFor(getGlobal(), propName, value)      pm.setValue(propName, value)
 def setGlobalRule(propName, ruleFactory):  def setGlobalRule(propName, ruleFactory):
Line 169 
Line 169 
 def setPropertyFor(obj, propName, value):  def setPropertyFor(obj, propName, value):
     pm = binding.findUtility(obj, IPropertyMap)      pm = binding.findUtility(obj, IPropertyMap)
     pm.setPropertyFor(obj, propName, value)      pm.setValue(propName, value)
 def setRuleFor(obj, propName, ruleFactory):  def setRuleFor(obj, propName, ruleFactory):

Generate output suitable for use with a patch program
Removed from v.554  
changed lines
  Added in v.555


Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help