~dricottone/huttese-apk

f73034c160c9dfdaea6ad9e1006c6e79710d380a — Drew DeVault 5 years ago 0d014d2
py3-emailthreads: add patches
A sr.ht/py3-emailthreads/0001-Don-t-strip-whitespace-from-lines.patch => sr.ht/py3-emailthreads/0001-Don-t-strip-whitespace-from-lines.patch +25 -0
@@ 0,0 1,25 @@
From 9019f3fb9c1a29ee0a04776d510f5e52cef6673b Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Thu, 9 May 2019 15:18:38 -0400
Subject: [PATCH 1/2] Don't strip whitespace from lines

---
 emailthreads/quotes.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/emailthreads/quotes.py b/emailthreads/quotes.py
index d7ebe53..4dd6b5d 100644
--- a/emailthreads/quotes.py
+++ b/emailthreads/quotes.py
@@ -60,8 +60,6 @@ def parse_blocks(msg):
 	block_lines = []
 	was_quoted = False
 	for (i, line) in enumerate(text_lines):
-		line = line.strip()
-
 		line_quoted = line.startswith(">")
 		if line_quoted:
 			line = line[1:].lstrip()
-- 
2.21.0


A sr.ht/py3-emailthreads/0002-Ignore-UTF-8-errors-when-decoding-emails.patch => sr.ht/py3-emailthreads/0002-Ignore-UTF-8-errors-when-decoding-emails.patch +25 -0
@@ 0,0 1,25 @@
From e173a3de0bd23d72fe3bd1a98194c17add934365 Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Thu, 9 May 2019 15:19:31 -0400
Subject: [PATCH 2/2] Ignore UTF-8 errors when decoding emails

---
 emailthreads/threads.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/emailthreads/threads.py b/emailthreads/threads.py
index 6b7c809..6f6a207 100644
--- a/emailthreads/threads.py
+++ b/emailthreads/threads.py
@@ -41,7 +41,7 @@ def normalize_whitespace(text):
 
 def get_text(msg):
 	text_part = get_text_part(msg)
-	text = text_part.get_payload(decode=True).decode('utf-8')
+	text = text_part.get_payload(decode=True).decode('utf-8', 'ignore')
 	text = normalize_whitespace(text)
 	return text
 
-- 
2.21.0


M sr.ht/py3-emailthreads/APKBUILD => sr.ht/py3-emailthreads/APKBUILD +8 -2
@@ 8,7 8,11 @@ arch="noarch"
license="MIT"
depends="python3"
makedepends="py-setuptools"
source="$pkgname-$pkgver.tar.gz::https://github.com/emersion/python-emailthreads/archive/v$pkgver.tar.gz"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/emersion/python-emailthreads/archive/v$pkgver.tar.gz
	0001-Don-t-strip-whitespace-from-lines.patch
	0002-Ignore-UTF-8-errors-when-decoding-emails.patch
"
builddir="$srcdir/python-emailthreads-${pkgver}"
options="!check" # no upstream test suite



@@ 22,4 26,6 @@ package() {
	python3 setup.py install --root="$pkgdir" --optimize=1
}

sha512sums="42e7fb8dfbfcbe514c44324816eca4fbb859410e3548458f32a18560dd52514a9236d860a8397d76eb992c30a0807c93aff896e95296f1f932d3693e975124e7  py3-emailthreads-0.1.0.tar.gz"
sha512sums="42e7fb8dfbfcbe514c44324816eca4fbb859410e3548458f32a18560dd52514a9236d860a8397d76eb992c30a0807c93aff896e95296f1f932d3693e975124e7  py3-emailthreads-0.1.0.tar.gz
467fda3c10394742d5a709addd2c24ff8eb27c294f912e651f1cf04e58802a501126d984b4d01323904aea4e216dd747cc681960c2157d04b6e21b0199c26bb2  0001-Don-t-strip-whitespace-from-lines.patch
e023086d3974cbff2b848deeaab00d26d27a4f2b060b5b53350af9e23a20d1055d78dccd35ec06fc4ee039ca8e0d861b8084b8c1bbb95a776f652b4611cac0f7  0002-Ignore-UTF-8-errors-when-decoding-emails.patch"