Helper for `.Artist.set` and `.Artist.update`. *errfmt* is used to generate error messages for invalid property names; it gets formatted with ``type(self)`` for "{cls}" and the property name for "{prop_name}".
(self, props, errfmt)
| 1252 | return ArtistInspector(self).properties() |
| 1253 | |
| 1254 | def _update_props(self, props, errfmt): |
| 1255 | """ |
| 1256 | Helper for `.Artist.set` and `.Artist.update`. |
| 1257 | |
| 1258 | *errfmt* is used to generate error messages for invalid property |
| 1259 | names; it gets formatted with ``type(self)`` for "{cls}" and the |
| 1260 | property name for "{prop_name}". |
| 1261 | """ |
| 1262 | ret = [] |
| 1263 | for k, v in props.items(): |
| 1264 | # Allow attributes we want to be able to update through |
| 1265 | # art.update, art.set, setp. |
| 1266 | if k == "axes": |
| 1267 | ret.append(setattr(self, k, v)) |
| 1268 | else: |
| 1269 | func = getattr(self, f"set_{k}", None) |
| 1270 | if not callable(func): |
| 1271 | raise AttributeError( |
| 1272 | errfmt.format(cls=type(self), prop_name=k), |
| 1273 | name=k) |
| 1274 | ret.append(func(v)) |
| 1275 | if ret: |
| 1276 | self.pchanged() |
| 1277 | self.stale = True |
| 1278 | return ret |
| 1279 | |
| 1280 | def update(self, props): |
| 1281 | """ |
no test coverage detected