|
From: <mi...@us...> - 2023-04-17 20:26:34
|
Revision: 9351
http://sourceforge.net/p/docutils/code/9351
Author: milde
Date: 2023-04-17 20:26:33 +0000 (Mon, 17 Apr 2023)
Log Message:
-----------
Fix test failure introduced in [r9348].
Reword and wrap warning message for incompatible content
of the bibliographic field "author".
Adapt "frontmatter" unit test cases.
Modified Paths:
--------------
trunk/docutils/docutils/transforms/frontmatter.py
trunk/docutils/test/test_transforms/test_docinfo.py
Modified: trunk/docutils/docutils/transforms/frontmatter.py
===================================================================
--- trunk/docutils/docutils/transforms/frontmatter.py 2023-04-16 20:46:39 UTC (rev 9350)
+++ trunk/docutils/docutils/transforms/frontmatter.py 2023-04-17 20:26:33 UTC (rev 9351)
@@ -513,14 +513,15 @@
raise TransformError
except TransformError:
field[-1] += self.document.reporter.warning(
- 'Bibliographic field "%s" incompatible with extraction: '
- 'it must contain either a single paragraph (with authors '
- 'separated by one of "%s"), multiple paragraphs (one per '
- 'author), or a bullet list with one paragraph (one author) '
- 'per item. Remember that leading initials can cause '
- '(mis)recognizing names as enumerated lists.'
- % (name, ''.join(self.language.author_separators)),
- base_node=field)
+ f'Cannot extract "{name}" from bibliographic field:\n'
+ f'Bibliographic field "{name}" must contain either\n'
+ ' a single paragraph (with author names separated by one of '
+ f'"{"".join(self.language.author_separators)}"),\n'
+ ' multiple paragraphs (one per author),\n'
+ ' or a bullet list with one author name per item.\n'
+ 'Note: Leading initials can cause (mis)recognizing names '
+ 'as enumerated list.',
+ base_node=field)
raise
def authors_from_one_paragraph(self, field):
Modified: trunk/docutils/test/test_transforms/test_docinfo.py
===================================================================
--- trunk/docutils/test/test_transforms/test_docinfo.py 2023-04-16 20:46:39 UTC (rev 9350)
+++ trunk/docutils/test/test_transforms/test_docinfo.py 2023-04-17 20:26:33 UTC (rev 9351)
@@ -358,7 +358,12 @@
Shaw
<system_message level="2" line="3" source="test data" type="WARNING">
<paragraph>
- Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. Remember that leading initials can cause (mis)recognizing names as enumerated lists.
+ Cannot extract "Authors" from bibliographic field:
+ Bibliographic field "Authors" must contain either
+ a single paragraph (with author names separated by one of ";,"),
+ multiple paragraphs (one per author),
+ or a bullet list with one author name per item.
+ Note: Leading initials can cause (mis)recognizing names as enumerated list.
<field classes="authors">
<field_name>
Authors
@@ -368,7 +373,12 @@
<list_item>
<system_message level="2" line="6" source="test data" type="WARNING">
<paragraph>
- Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. Remember that leading initials can cause (mis)recognizing names as enumerated lists.
+ Cannot extract "Authors" from bibliographic field:
+ Bibliographic field "Authors" must contain either
+ a single paragraph (with author names separated by one of ";,"),
+ multiple paragraphs (one per author),
+ or a bullet list with one author name per item.
+ Note: Leading initials can cause (mis)recognizing names as enumerated list.
<field classes="authors">
<field_name>
Authors
@@ -381,7 +391,12 @@
Two
<system_message level="2" line="10" source="test data" type="WARNING">
<paragraph>
- Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. Remember that leading initials can cause (mis)recognizing names as enumerated lists.
+ Cannot extract "Authors" from bibliographic field:
+ Bibliographic field "Authors" must contain either
+ a single paragraph (with author names separated by one of ";,"),
+ multiple paragraphs (one per author),
+ or a bullet list with one author name per item.
+ Note: Leading initials can cause (mis)recognizing names as enumerated list.
<field classes="authors">
<field_name>
Authors
@@ -394,7 +409,12 @@
Two
<system_message level="2" line="15" source="test data" type="WARNING">
<paragraph>
- Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. Remember that leading initials can cause (mis)recognizing names as enumerated lists.
+ Cannot extract "Authors" from bibliographic field:
+ Bibliographic field "Authors" must contain either
+ a single paragraph (with author names separated by one of ";,"),
+ multiple paragraphs (one per author),
+ or a bullet list with one author name per item.
+ Note: Leading initials can cause (mis)recognizing names as enumerated list.
"""],
["""\
.. RCS keyword extraction.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|