From e2c7648d0bb220564f15dba1357039897c49c85b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 2 May 2020 17:16:24 +0000 Subject: [PATCH] Prepend From --- git.py | 6 +++--- inbox.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/git.py b/git.py index ca43f16ee..287376f2a 100644 --- a/git.py +++ b/git.py @@ -9,14 +9,14 @@ __status__ = "Production" import os -def gitFormatContent(content) -> str: +def gitFormatContent(content: str) -> str: """ replace html formatting, so that it's more like the original patch file """ - contentStr = content.replace('
', '\n').replace('
', '\n') + contentStr = content.replace('
', '\n').replace('
', '\n') contentStr = contentStr.replace('

', '').replace('

', '\n') if 'From ' in contentStr: - contentStr = contentStr.split('From ', 1)[1] + contentStr = 'From ' + contentStr.split('From ', 1)[1] return contentStr diff --git a/inbox.py b/inbox.py index d783d812e..7817dbe53 100644 --- a/inbox.py +++ b/inbox.py @@ -62,6 +62,7 @@ from git import isGitPatch from git import receiveGitPatch from git import gitFormatContent + def storeHashTags(baseDir: str, nickname: str, postJsonObject: {}) -> None: """Extracts hashtags from an incoming post and updates the relevant tags files. @@ -1708,7 +1709,7 @@ def gitPatchNotify(baseDir: str, handle: str, patchFile = accountDir + '/.newPatch' with open(patchFile, 'w') as fp: fp.write(subject) - + with open(patchFile + 'Content', 'w') as fp: fp.write(gitFormatContent(content))