mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-06 15:13:51 +02:00
New package: python3-rst2ansi-0.1.5
This commit is contained in:
parent
7ec5fff125
commit
61d9c40c7c
3 changed files with 79 additions and 0 deletions
31
srcpkgs/python3-rst2ansi/patches/table-fix.patch
Normal file
31
srcpkgs/python3-rst2ansi/patches/table-fix.patch
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
From 1b1b963804bcc87a7187d07c3943585d9385ea92 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jakub Wilk <jwilk@jwilk.net>
|
||||||
|
Date: Thu, 14 Jul 2016 13:39:31 +0200
|
||||||
|
Subject: [PATCH 1/2] Fix name error
|
||||||
|
|
||||||
|
---
|
||||||
|
rst2ansi/table.py | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/rst2ansi/table.py b/rst2ansi/table.py
|
||||||
|
index 389eb38..9f867a5 100644
|
||||||
|
--- a/rst2ansi/table.py
|
||||||
|
+++ b/rst2ansi/table.py
|
||||||
|
@@ -91,7 +91,7 @@ def noop(*args, **kwargs):
|
||||||
|
|
||||||
|
def visit_table(self, node):
|
||||||
|
if self.level > 0:
|
||||||
|
- raise SkipChildren
|
||||||
|
+ raise nodes.SkipChildren
|
||||||
|
self.level += 1
|
||||||
|
|
||||||
|
def depart_table(self, node):
|
||||||
|
@@ -197,7 +197,7 @@ def _draw_rule(self):
|
||||||
|
|
||||||
|
def visit_table(self, node):
|
||||||
|
if self.level > 0:
|
||||||
|
- raise SkipChildren
|
||||||
|
+ raise nodes.SkipChildren
|
||||||
|
self.level += 1
|
||||||
|
self._draw_rule()
|
||||||
|
|
25
srcpkgs/python3-rst2ansi/patches/unicode.patch
Normal file
25
srcpkgs/python3-rst2ansi/patches/unicode.patch
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
From c6f390b45be689a5760060c990e3fe10f502e671 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Franklin \"Snaipe\" Mathieu" <snaipe@arista.com>
|
||||||
|
Date: Mon, 25 Jan 2021 18:06:51 +0100
|
||||||
|
Subject: [PATCH 2/2] api: fix AttributeError on decode when feeding unicode
|
||||||
|
strings in python3
|
||||||
|
|
||||||
|
Fixes #12, #13
|
||||||
|
---
|
||||||
|
rst2ansi/__init__.py | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/rst2ansi/__init__.py b/rst2ansi/__init__.py
|
||||||
|
index f0665f4..0ea9a97 100644
|
||||||
|
--- a/rst2ansi/__init__.py
|
||||||
|
+++ b/rst2ansi/__init__.py
|
||||||
|
@@ -45,5 +45,8 @@ def style_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||||
|
for style in STYLES:
|
||||||
|
roles.register_local_role('ansi-' + style, style_role)
|
||||||
|
|
||||||
|
- out = core.publish_string(input_string.decode('utf-8'), settings_overrides=overrides, writer=Writer(unicode=output_encoding.startswith('utf')))
|
||||||
|
+ if hasattr(input_string, 'decode'):
|
||||||
|
+ input_string = input_string.decode('utf-8')
|
||||||
|
+
|
||||||
|
+ out = core.publish_string(input_string, settings_overrides=overrides, writer=Writer(unicode=output_encoding.startswith('utf')))
|
||||||
|
return out.decode(output_encoding)
|
23
srcpkgs/python3-rst2ansi/template
Normal file
23
srcpkgs/python3-rst2ansi/template
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Template file for 'python3-rst2ansi'
|
||||||
|
pkgname=python3-rst2ansi
|
||||||
|
version=0.1.5
|
||||||
|
revision=1
|
||||||
|
build_style=python3-module
|
||||||
|
hostmakedepends="python3-setuptools"
|
||||||
|
depends="python3-docutils"
|
||||||
|
short_desc="Python utility for rendering RST in the terminal"
|
||||||
|
maintainer="Andrew J. Hesford <ajh@sideband.org>"
|
||||||
|
license="MIT"
|
||||||
|
homepage="https://github.com/Snaipe/python-rst2ansi"
|
||||||
|
distfiles="
|
||||||
|
${PYPI_SITE}/r/rst2ansi/rst2ansi-${version}.tar.gz
|
||||||
|
https://raw.githubusercontent.com/Snaipe/python-rst2ansi/v${version}/LICENSE
|
||||||
|
"
|
||||||
|
checksum="1b17fb9a628d40f57933ad1a3aa952346444be069469508e73e95060da33fe6f
|
||||||
|
f9e900cbd36e32459517036a0e55e437c6311dca5eee1a9086df9f525e94d8c0"
|
||||||
|
make_check=no # package defines no tests
|
||||||
|
skip_extraction="LICENSE"
|
||||||
|
|
||||||
|
post_install() {
|
||||||
|
vlicense "${XBPS_SRCDISTDIR}/${sourcepkg}-${version}/LICENSE"
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue