@@ -93,7 +93,7 @@ def dwalk(D: dict, I: dict):
9393 The user's config dictionary to be processed.
9494 """
9595 if not 'attributes' in D :
96- raise ValueError (f'Directive { D ["name" ]} has no attributes; cannot walk through it.' )
96+ raise ValueError (f'Attribute { D ["name" ]} has no attributes; cannot walk through it.' )
9797 # get the name of each config attribute at this level in this block
9898 tld = [x ['name' ] for x in D ['attributes' ]]
9999 if I == None :
@@ -102,7 +102,7 @@ def dwalk(D: dict, I: dict):
102102 ud = list (I .keys ())
103103 for u in ud :
104104 if not u in tld :
105- raise_clean (ValueError (f'Directive \' { u } \' invalid; expecting one of { tld } under \' { D ["name" ]} \' .' ))
105+ raise_clean (ValueError (f'Attribute \' { u } \' invalid; expecting one of { tld } under \' { D ["name" ]} \' .' ))
106106 # logger.debug(f'dwalk along {tld} for {I}')
107107 # for each attribute name
108108 for d in tld :
@@ -114,7 +114,7 @@ def dwalk(D: dict, I: dict):
114114 # get its type
115115 typ = dx ['type' ]
116116 if typ == 'dict' and (d in I and not type (I [d ]) == dict ):
117- raise_clean (ValueError (f'Directive \' { d } \' of \' { D ["name" ]} \' must be a dict; found { type (I [d ])} .' ))
117+ raise_clean (ValueError (f'Attribute \' { d } \' of \' { D ["name" ]} \' must be a dict; found { type (I [d ])} .' ))
118118 # logger.debug(f' - {d} typ {typ} I {I[d]}
119119 # logger.debug(f'- {d} typ {typ} I {I}')
120120 # if this attribute name does not already have a key in the result
@@ -129,7 +129,7 @@ def dwalk(D: dict, I: dict):
129129 # if it is flagged as required, die since it is not in the read-in
130130 elif 'required' in dx :
131131 if dx ['required' ]:
132- raise_clean (ValueError (f'Directive \' { d } \' of \' { D ["name" ]} \' requires a value.' ))
132+ raise_clean (ValueError (f'Attribute \' { d } \' of \' { D ["name" ]} \' requires a value.' ))
133133 # if it is a dict
134134 elif typ == 'dict' :
135135 # if it is explicitly tagged as not required, do nothing
@@ -159,11 +159,11 @@ def dwalk(D: dict, I: dict):
159159 if not case_sensitive :
160160 # just check the choices that were provided by the user
161161 if not I [d ].casefold () in [x .casefold () for x in dx ['choices' ]]:
162- raise_clean (ValueError (f'Directive \' { d } \' of \' { dx ["name" ]} \' must be one of { ", " .join (dx ["choices" ])} (case-insensitive); found \' { I [d ]} \' ' ))
162+ raise_clean (ValueError (f'Attribute \' { d } \' of \' { dx ["name" ]} \' must be one of { ", " .join (dx ["choices" ])} (case-insensitive); found \' { I [d ]} \' ' ))
163163 else :
164164 # check the choices that were provided by the user
165165 if not I [d ] in dx ['choices' ]:
166- raise_clean (ValueError (f'Directive \' { d } \' of \' { dx ["name" ]} \' must be one of { ", " .join (dx ["choices" ])} ; found \' { I [d ]} \' ' ))
166+ raise_clean (ValueError (f'Attribute \' { d } \' of \' { dx ["name" ]} \' must be one of { ", " .join (dx ["choices" ])} ; found \' { I [d ]} \' ' ))
167167 elif typ == 'dict' :
168168 # process descendants
169169 if 'attributes' in dx :
@@ -179,7 +179,7 @@ def dwalk(D: dict, I: dict):
179179 I [d ] = defaults + I [d ]
180180 elif typ == 'tuple' :
181181 if 'attributes' in dx :
182- raise_clean (TypeError (f'Directive \' { d } \' of \' { D ["name" ]} \' cannot have subattributes.' ))
182+ raise_clean (TypeError (f'Attribute \' { d } \' of \' { D ["name" ]} \' cannot have subattributes.' ))
183183 I [d ] = dx .get ('default' , ())
184184
185185def lwalk (D : dict , L : list [dict ]):
0 commit comments