|
From: <mi...@us...> - 2024-06-14 15:04:08
|
Revision: 9760
http://sourceforge.net/p/docutils/code/9760
Author: milde
Date: 2024-06-14 15:04:05 +0000 (Fri, 14 Jun 2024)
Log Message:
-----------
Remove `docutils.core.Publisher.setup_option_parser()`.
internal, obsolete
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/core.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2024-06-14 15:03:55 UTC (rev 9759)
+++ trunk/docutils/HISTORY.txt 2024-06-14 15:04:05 UTC (rev 9760)
@@ -27,6 +27,10 @@
- Allow multiple <term> elements in a <definition_list_item>.
Fixes feature-request #60
+* docutils/core.py
+
+ - Removed `Publisher.setup_option_parser()` (internal, obsolete).
+
* docutils/frontend.py
- Drop short options ``-i`` and ``-o`` for ``--input-encoding``
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2024-06-14 15:03:55 UTC (rev 9759)
+++ trunk/docutils/RELEASE-NOTES.txt 2024-06-14 15:04:05 UTC (rev 9760)
@@ -224,6 +224,8 @@
* Removed objects:
+ `docutils.core.Publisher.setup_option_parser()`
+ internal, obsolete
`docutils.nodes.Element.set_class()`
Obsolete. Append to Element['classes'] directly.
`docutils.utils.error_reporting`
@@ -335,8 +337,6 @@
Python 2 compatibility hacks
`docutils.utils.Reporter.set_conditions()`
obsolete
- `docutils.core.Publisher.setup_option_parser()`
- internal, obsolete
* New files:
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2024-06-14 15:03:55 UTC (rev 9759)
+++ trunk/docutils/docutils/core.py 2024-06-14 15:04:05 UTC (rev 9760)
@@ -103,32 +103,27 @@
if self.writer is None:
self.set_writer(writer_name)
- def setup_option_parser(self, usage=None, description=None,
- settings_spec=None, config_section=None,
- **defaults):
- warnings.warn('Publisher.setup_option_parser is deprecated, '
- 'and will be removed in Docutils 0.21.',
- DeprecationWarning, stacklevel=2)
- if config_section:
- if not settings_spec:
- settings_spec = SettingsSpec()
- settings_spec.config_section = config_section
- parts = config_section.split()
- if len(parts) > 1 and parts[-1] == 'application':
- settings_spec.config_section_dependencies = ['applications']
- # @@@ Add self.source & self.destination to components in future?
- return OptionParser(
- components=(self.parser, self.reader, self.writer, settings_spec),
- defaults=defaults, read_config_files=True,
- usage=usage, description=description)
-
- def _setup_settings_parser(self, *args, **kwargs):
+ def _setup_settings_parser(self, usage=None, description=None,
+ settings_spec=None, config_section=None,
+ **defaults):
# Provisional: will change (docutils.frontend.OptionParser will
# be replaced by a parser based on arparse.ArgumentParser)
# and may be removed later.
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=DeprecationWarning)
- return self.setup_option_parser(*args, **kwargs)
+ if config_section:
+ if not settings_spec:
+ settings_spec = SettingsSpec()
+ settings_spec.config_section = config_section
+ parts = config_section.split()
+ if len(parts) > 1 and parts[-1] == 'application':
+ settings_spec.config_section_dependencies = ['applications'] # noqa: E501
+ # @@@ Add self.source & self.destination to components in future?
+ return OptionParser(
+ components=(self.parser, self.reader, self.writer,
+ settings_spec),
+ defaults=defaults, read_config_files=True,
+ usage=usage, description=description)
def get_settings(self, usage=None, description=None,
settings_spec=None, config_section=None, **defaults):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|