Add compatibility with docutils 0.13
In docutils 0.13.1, the get_column_widths method of Table directive returns a tuple, where the widths array is the second item. Also, get_column_widths now has a “if type(self.widths) == list” check, so use the list syntax when setting the widths property. Change-Id: I9888a649313c60257ce6dfc46cfbd2dcbf7ac189
This commit is contained in:
parent
f694119d39
commit
f30d53cda0
|
@ -357,8 +357,13 @@ class RestParametersDirective(Table):
|
|||
# TODO(sdague): it would be good to dynamically set column
|
||||
# widths (or basically make the colwidth thing go away
|
||||
# entirely)
|
||||
self.options['widths'] = (20, 10, 10, 60)
|
||||
self.options['widths'] = [20, 10, 10, 60]
|
||||
self.col_widths = self.get_column_widths(self.max_cols)
|
||||
if isinstance(self.col_widths, tuple):
|
||||
# In docutils 0.13.1, get_column_widths returns a (widths,
|
||||
# colwidths) tuple, where widths is a string (i.e. 'auto').
|
||||
# See https://sourceforge.net/p/docutils/patches/120/.
|
||||
self.col_widths = self.col_widths[1]
|
||||
# Actually convert the yaml
|
||||
title, messages = self.make_title()
|
||||
# self.app.info("Title %s, messages %s" % (title, messages))
|
||||
|
|
|
@ -100,8 +100,13 @@ class HTTPResponseCodeDirective(Table):
|
|||
# TODO(sdague): it would be good to dynamically set column
|
||||
# widths (or basically make the colwidth thing go away
|
||||
# entirely)
|
||||
self.options['widths'] = (30, 70)
|
||||
self.options['widths'] = [30, 70]
|
||||
self.col_widths = self.get_column_widths(self.max_cols)
|
||||
if isinstance(self.col_widths, tuple):
|
||||
# In docutils 0.13.1, get_column_widths returns a (widths,
|
||||
# colwidths) tuple, where widths is a string (i.e. 'auto').
|
||||
# See https://sourceforge.net/p/docutils/patches/120/.
|
||||
self.col_widths = self.col_widths[1]
|
||||
# Actually convert the yaml
|
||||
title, messages = self.make_title()
|
||||
# self.app.info("Title %s, messages %s" % (title, messages))
|
||||
|
|
Loading…
Reference in New Issue