Ver código fonte

Document how inheritance on Metadata classes works

tags/v1.0
JustAnotherArchivist 1 ano atrás
pai
commit
7eb175fb63
1 arquivos alterados com 5 adições e 1 exclusões
  1. +5
    -1
      codearchiver/core.py

+ 5
- 1
codearchiver/core.py Ver arquivo

@@ -83,7 +83,11 @@ class MetadataField:




class Metadata(list[tuple[str, str]]): class Metadata(list[tuple[str, str]]):
'''Metadata (key-value mapping, possibly with repeated keys) of a file produced by a module'''
'''
Metadata (key-value mapping, possibly with repeated keys) of a file produced by a module

Fields are inherited. Subclasses meant to be usable should define their own version; the 'Metadata version' field is set by `Module.create_metadata` and collects all declared versions.
'''


fields: tuple[MetadataField] = ( fields: tuple[MetadataField] = (
MetadataField('codearchiver version', required = True, repeatable = False), MetadataField('codearchiver version', required = True, repeatable = False),


Carregando…
Cancelar
Salvar