Re: [PATCH] docs: sphinx-extensions: make rstFlatTable work with docutils 0.13

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 18 Dec 2016 13:11:46 +0300
Dmitry Shachnev <mitya57@xxxxxxxxxx> wrote:

> In docutils 0.13, the return type of get_column_widths method of the
> Table directive has changed [1], which breaks our flat-table directive
> and leads to a TypeError when trying to build the docs [2].
> 
> This patch adds support for the new return type, while keeping support
> for older docutils versions too.

OK, I pulled in docutils 0.13 (virtualenv is great stuff) and was able to
verify both the problem and the fix.  Applied to doc-next with a
cc: stable.  I'll send it Linusward in the near future.

> [1] https://sourceforge.net/p/docutils/patches/120/
> [2] https://sourceforge.net/p/docutils/bugs/303/
> 
> Signed-off-by: Dmitry Shachnev <mitya57@xxxxxxxxxx>
> ---
>  Documentation/sphinx/rstFlatTable.py | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/sphinx/rstFlatTable.py b/Documentation/sphinx/rstFlatTable.py
> index 55f2757..25feb0d 100755
> --- a/Documentation/sphinx/rstFlatTable.py
> +++ b/Documentation/sphinx/rstFlatTable.py
> @@ -157,6 +157,11 @@ class ListTableBuilder(object):
>      def buildTableNode(self):
>  
>          colwidths    = self.directive.get_column_widths(self.max_cols)
> +        if isinstance(colwidths, tuple):
> +            # Since docutils 0.13, get_column_widths returns a (widths,
> +            # colwidths) tuple, where widths is a string (i.e. 'auto').
> +            # See https://sourceforge.net/p/docutils/patches/120/.
> +            colwidths = colwidths[1]
>          stub_columns = self.directive.options.get('stub-columns', 0)
>          header_rows  = self.directive.options.get('header-rows', 0)
>  
> --
> 2.10.2
> 
> Dear Linux documentation maintainers,
> 
> This is my first kernel patch, so if I am doing something wrong, please
> correct me.

You are off to a great start!  This is just the sort of patch we like to
see: it fixes a real problem and explains what the issue is.

Thanks,

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux