specitems 1.2.0__tar.gz → 1.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {specitems-1.2.0 → specitems-1.2.2}/PKG-INFO +1 -1
  2. {specitems-1.2.0 → specitems-1.2.2}/pyproject.toml +1 -1
  3. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/cite.py +6 -3
  4. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/spec.pickle +0 -0
  5. {specitems-1.2.0 → specitems-1.2.2}/README.md +0 -0
  6. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/__init__.py +0 -0
  7. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/clihash.py +0 -0
  8. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/clipickle.py +0 -0
  9. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/clispecdoc.py +0 -0
  10. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/cliutil.py +0 -0
  11. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/cliyamlquery.py +0 -0
  12. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/content.py +0 -0
  13. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/contentmarkdown.py +0 -0
  14. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/contentsphinx.py +0 -0
  15. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/contenttext.py +0 -0
  16. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/getvaluesubprocess.py +0 -0
  17. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/glossary.py +0 -0
  18. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/hashutil.py +0 -0
  19. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/itemmapper.py +0 -0
  20. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/items.py +0 -0
  21. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/py.typed +0 -0
  22. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/specdoc.py +0 -0
  23. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/specverify.py +0 -0
  24. {specitems-1.2.0 → specitems-1.2.2}/src/specitems/subprocessaction.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: specitems
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: Provides interfaces to work with specification items.
5
5
  Keywords: certification,documentation,markdown,qualification,requirements-management,traceability
6
6
  Author: The specitems Authors
@@ -4,7 +4,7 @@
4
4
 
5
5
  [project]
6
6
  name = "specitems"
7
- version = "1.2.0"
7
+ version = "1.2.2"
8
8
  description = "Provides interfaces to work with specification items."
9
9
  authors = [
10
10
  {name = "The specitems Authors", email = "specthings@embedded-brains.de"}
@@ -103,6 +103,10 @@ class BibTeXCitationProvider(ItemValueProvider):
103
103
  else:
104
104
  self._get_fields[type_path] = get_fields
105
105
 
106
+ def get_fields(self, item: Item) -> tuple[str, _Fields]:
107
+ """ Get the BibTeX type and fields of the item. """
108
+ return self._get_fields.get(item.type, _get_fields)(item)
109
+
106
110
  def add_get_fields(self, item_type: str, get_fields: _GetFields) -> None:
107
111
  """ Add the get fields method for the item type. """
108
112
  self.mapper.add_get_value(f"{item_type}:/cite", self._get_cite)
@@ -116,8 +120,7 @@ class BibTeXCitationProvider(ItemValueProvider):
116
120
  def add_bibtex_entries(self, content: TextContent) -> None:
117
121
  """ Add BibTeX entries for the collected citations to the content. """
118
122
  for item in sorted(self._citations):
119
- publication_type, fields = self._get_fields.get(
120
- item.type, _get_fields)(item)
123
+ publication_type, fields = self.get_fields(item)
121
124
  for key in _PERSONS.intersection(fields.keys()):
122
125
  if isinstance(fields[key], list):
123
126
  fields[key] = " and ".join(fields[key])
@@ -140,7 +143,7 @@ class BibTeXCitationProvider(ItemValueProvider):
140
143
 
141
144
  def _get_cite_long(self, ctx: ItemGetValueContext) -> str:
142
145
  self._citations.add(ctx.item)
143
- _, fields = self._get_fields.get(ctx.item.type, _get_fields)(ctx.item)
146
+ _, fields = self.get_fields(ctx.item)
144
147
  assert isinstance(self.mapper, TextMapper)
145
148
  content = self.mapper.create_content()
146
149
  title = fields["title"]
index fcb9985..bd2f0e9 100644
Binary file
File without changes