class documentation

class MetadataStore: (source)

Known subclasses: mypy.metastore.FilesystemMetadataStore, mypy.metastore.SqliteMetadataStore

View In Hierarchy

Generic interface for metadata storage.
Method commit If the backing store requires a commit, do it.
Method getmtime Read the mtime of a metadata entry..
Method list​_all Undocumented
Method read Read the contents of a metadata entry.
Method remove Delete a metadata entry
Method write Write a metadata entry.
@abstractmethod
def commit(self): (source)

If the backing store requires a commit, do it.

But N.B. that this is not guaranteed to do anything, and there is no guarantee that changes are not made until it is called.

@abstractmethod
def getmtime(self, name): (source)

Read the mtime of a metadata entry..

Raises FileNotFound if the entry does not exist.

Parameters
name:strUndocumented
Returns
floatUndocumented
@abstractmethod
def list_all(self): (source)

Undocumented

Returns
Iterable[str]Undocumented
@abstractmethod
def read(self, name): (source)

Read the contents of a metadata entry.

Raises FileNotFound if the entry does not exist.

Parameters
name:strUndocumented
Returns
strUndocumented
@abstractmethod
def remove(self, name): (source)
Delete a metadata entry
Parameters
name:strUndocumented
@abstractmethod
def write(self, name, data, mtime=None): (source)

Write a metadata entry.

If mtime is specified, set it as the mtime of the entry. Otherwise, the current time is used.

Returns True if the entry is successfully written, False otherwise.

Parameters
name:strUndocumented
data:strUndocumented
mtime:Optional[float]Undocumented
Returns
boolUndocumented