From f07e0a6324da6ab0093e9b6b936266b6832f0abf Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 5 Nov 2012 15:01:21 -0500 Subject: [PATCH] zephyr_mirror: Make paragraph break detection a bit less aggressive. Because in the zephyr world, people often manually linewrap their zephyrs, we need to relax the algorithm's assumption that every line was wrapped to the same linewrapping threshhold. Otherwise messages that look like this: aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaaa aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa might be treated as a paragraph break, even though that was unlikely to have been the sender's intention. (imported from commit e1144da2a3efc3241a8f15b0f19fea2ea6684254) --- api/bots/zephyr_mirror.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/bots/zephyr_mirror.py b/api/bots/zephyr_mirror.py index 79758f76cf..5642c6084f 100755 --- a/api/bots/zephyr_mirror.py +++ b/api/bots/zephyr_mirror.py @@ -98,7 +98,7 @@ def to_zephyr_username(humbug_username): def early_indent(line, next_line): words = next_line.split() - return len(line + " " + words[0]) < len(next_line) + return len(line + " " + words[0]) < len(next_line) * 0.8 # Linewrapping algorithm based on: # http://gcbenison.wordpress.com/2011/07/03/a-program-to-intelligently-remove-carriage-returns-so-you-can-paste-text-without-having-it-look-awful/