Table of Contents

Class: ConflictManager ./src/peak/util/ConflictManager.py

Manage potentially-conflicting settings from multiple sources

Usage:: cm = ConflictManager()

# This keeps the "most-specific" data (shortest non-conflicting path) # or raises an error if a conflicting setting is made cm[key] = path, setting

for setting in cm.values(): # process setting

Keys can be any hashable value. path objects must be sequences of a uniform type, representing an "inclusion path". For example, if the settings are being read from a file foo that was included within a file bar, then the path would be ("bar","foo"). If foo then includes a file baz, its path would be ("bar","foo","baz"). For any given pair of settings, one is kept if its path is a prefix of the other path. If neither path is a prefix of the other, or the paths are equal, a KeyError will be raised to indicate a conflict.

At any time, the current settings can be read back out via the values() method.

Methods   
__getitem__
__init__
__setitem__
clear
values
  __getitem__ 
__getitem__ ( self,  key )

  __init__ 
__init__ ( self )

  __setitem__ 
__setitem__ (
        self,
        key,
        (,
        )

Exceptions   
KeyError
  clear 
clear ( self )

  values 
values ( self )


Table of Contents

This document was automatically generated on Mon Apr 15 01:11:04 2024 by HappyDoc version 2.1