File tree Expand file tree Collapse file tree 5 files changed +11
-9
lines changed
sphinxcontrib/confluencebuilder/config Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -1524,7 +1524,7 @@ Advanced publishing configuration
1524
1524
1525
1525
.. versionchanged :: 2.6
1526
1526
1527
- Introduce the ``headers_and_data `` option.
1527
+ Introduce the ``headers-and-data `` option.
1528
1528
1529
1529
.. warning ::
1530
1530
@@ -1544,7 +1544,7 @@ Advanced publishing configuration
1544
1544
- ``deprecated ``: Log warnings when a deprecated API call is used
1545
1545
(*for development purposes *).
1546
1546
- ``headers ``: Log requests and responses, including their headers.
1547
- - ``headers_and_data ``: Log header data along with request/response bodies.
1547
+ - ``headers-and-data ``: Log header data along with request/response bodies.
1548
1548
- ``urllib3 ``: Enable urllib3 library debugging messages.
1549
1549
1550
1550
An example debugging configuration is as follows:
Original file line number Diff line number Diff line change @@ -533,15 +533,13 @@ def conf_translate(value):
533
533
# ##################################################################
534
534
535
535
# confluence_publish_debug
536
- opts = PublishDebug ._member_names_ # pylint: disable=no-member
537
536
try :
538
537
validator .conf ('confluence_publish_debug' ).bool () # deprecated
539
538
except ConfluenceConfigError :
540
539
try :
541
540
validator .conf ('confluence_publish_debug' ).enum (PublishDebug )
542
541
except ConfluenceConfigError as ex :
543
- opts_str = '\n - ' .join (opts )
544
- raise ConfluencePublishDebugConfigError (ex , opts_str ) from ex
542
+ raise ConfluencePublishDebugConfigError (ex ) from ex
545
543
546
544
# ##################################################################
547
545
Original file line number Diff line number Diff line change @@ -107,7 +107,8 @@ def apply_defaults(builder):
107
107
if publish_debug is True :
108
108
conf .confluence_publish_debug = PublishDebug .urllib3
109
109
elif isinstance (publish_debug , str ) and publish_debug :
110
- conf .confluence_publish_debug = PublishDebug [publish_debug .lower ()]
110
+ raw_debug = publish_debug .replace ('-' , '_' ).lower ()
111
+ conf .confluence_publish_debug = PublishDebug [raw_debug ]
111
112
else :
112
113
conf .confluence_publish_debug = PublishDebug .none
113
114
Original file line number Diff line number Diff line change @@ -229,15 +229,18 @@ def __init__(self):
229
229
230
230
231
231
class ConfluencePublishDebugConfigError (ConfluenceConfigError ):
232
- def __init__ (self , msg , opts ):
232
+ def __init__ (self , msg ):
233
233
super ().__init__ (f'''\
234
234
{ msg }
235
235
236
236
The option 'confluence_publish_debug' has been configured to enable publish
237
237
debugging. Accepted values include:
238
238
239
239
- all
240
- - { opts }
240
+ - deprecated
241
+ - headers
242
+ - headers-and-data
243
+ - urllib3
241
244
''' )
242
245
243
246
Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ def enum(self, etype):
218
218
219
219
if value is not None and not isinstance (value , etype ):
220
220
try :
221
- value = etype [value .lower ()]
221
+ value = etype [value .replace ( '-' , '_' ). lower ()]
222
222
except (AttributeError , KeyError ) as ex :
223
223
msg = f'{ self .key } is not an enumeration ({ etype .__name__ } )'
224
224
raise ConfluenceConfigError (msg ) from ex
You can’t perform that action at this time.
0 commit comments