mirror of https://gitlab.com/bashrc2/epicyon
Prepend From
parent
03f88377dd
commit
e2c7648d0b
6
git.py
6
git.py
|
@ -9,14 +9,14 @@ __status__ = "Production"
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
def gitFormatContent(content) -> str:
|
def gitFormatContent(content: str) -> str:
|
||||||
""" replace html formatting, so that it's more
|
""" replace html formatting, so that it's more
|
||||||
like the original patch file
|
like the original patch file
|
||||||
"""
|
"""
|
||||||
contentStr = content.replace('<br>', '\n').replace('<br \>', '\n')
|
contentStr = content.replace('<br>', '\n').replace('<br \\>', '\n')
|
||||||
contentStr = contentStr.replace('<p>', '').replace('</p>', '\n')
|
contentStr = contentStr.replace('<p>', '').replace('</p>', '\n')
|
||||||
if 'From ' in contentStr:
|
if 'From ' in contentStr:
|
||||||
contentStr = contentStr.split('From ', 1)[1]
|
contentStr = 'From ' + contentStr.split('From ', 1)[1]
|
||||||
return contentStr
|
return contentStr
|
||||||
|
|
||||||
|
|
||||||
|
|
3
inbox.py
3
inbox.py
|
@ -62,6 +62,7 @@ from git import isGitPatch
|
||||||
from git import receiveGitPatch
|
from git import receiveGitPatch
|
||||||
from git import gitFormatContent
|
from git import gitFormatContent
|
||||||
|
|
||||||
|
|
||||||
def storeHashTags(baseDir: str, nickname: str, postJsonObject: {}) -> None:
|
def storeHashTags(baseDir: str, nickname: str, postJsonObject: {}) -> None:
|
||||||
"""Extracts hashtags from an incoming post and updates the
|
"""Extracts hashtags from an incoming post and updates the
|
||||||
relevant tags files.
|
relevant tags files.
|
||||||
|
@ -1708,7 +1709,7 @@ def gitPatchNotify(baseDir: str, handle: str,
|
||||||
patchFile = accountDir + '/.newPatch'
|
patchFile = accountDir + '/.newPatch'
|
||||||
with open(patchFile, 'w') as fp:
|
with open(patchFile, 'w') as fp:
|
||||||
fp.write(subject)
|
fp.write(subject)
|
||||||
|
|
||||||
with open(patchFile + 'Content', 'w') as fp:
|
with open(patchFile + 'Content', 'w') as fp:
|
||||||
fp.write(gitFormatContent(content))
|
fp.write(gitFormatContent(content))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue