ItemMapping

class glotaran.project.project_registry.ItemMapping(data: Mapping[str, Path], item_name: str)[source]

Bases: Mapping

Container class for ProjectRegistry items.

The main purpose of this class is to show a user friendly error when accessing none existing items.

Initialize class instance as wrapper around data.

Parameters:
  • data (Mapping[str, Path]) – Underlying data that are used for mapping.

  • item_name (str) – Name of items in the registry used to format warning and exception (e.g. ‘Parameters’).

Methods Summary

get

items

keys

values

Methods Documentation

get(k[, d]) D[k] if k in D, else d.  d defaults to None.
items() a set-like object providing a view on D's items
keys() a set-like object providing a view on D's keys
values() an object providing a view on D's values