mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
500e72f064
commit
9194d95b17
|
@ -111,18 +111,12 @@ def manualApproveFollowRequest(session, baseDir: str,
|
||||||
reqNick = approveHandle.split('@')[0]
|
reqNick = approveHandle.split('@')[0]
|
||||||
reqDomain = approveHandle.split('@')[1].strip()
|
reqDomain = approveHandle.split('@')[1].strip()
|
||||||
reqPrefix = httpPrefix + '://' + reqDomain
|
reqPrefix = httpPrefix + '://' + reqDomain
|
||||||
if reqPrefix + '/profile/' + reqNick in approveFollowsStr:
|
paths = ('/profile/', '/channel/', '/accounts/', '/u/')
|
||||||
exists = True
|
for userPath in paths:
|
||||||
approveHandleFull = reqPrefix + '/profile/' + reqNick
|
if reqPrefix + userPath + reqNick in approveFollowsStr:
|
||||||
elif reqPrefix + '/channel/' + reqNick in approveFollowsStr:
|
exists = True
|
||||||
exists = True
|
approveHandleFull = reqPrefix + userPath + reqNick
|
||||||
approveHandleFull = reqPrefix + '/channel/' + reqNick
|
break
|
||||||
elif reqPrefix + '/accounts/' + reqNick in approveFollowsStr:
|
|
||||||
exists = True
|
|
||||||
approveHandleFull = reqPrefix + '/accounts/' + reqNick
|
|
||||||
elif reqPrefix + '/u/' + reqNick in approveFollowsStr:
|
|
||||||
exists = True
|
|
||||||
approveHandleFull = reqPrefix + '/u/' + reqNick
|
|
||||||
if not exists:
|
if not exists:
|
||||||
print('Manual follow accept: ' + approveHandleFull +
|
print('Manual follow accept: ' + approveHandleFull +
|
||||||
' not in requests file "' +
|
' not in requests file "' +
|
||||||
|
|
33
markdown.py
33
markdown.py
|
@ -140,29 +140,22 @@ def markdownToHtml(markdown: str) -> str:
|
||||||
linesList = markdown.split('\n')
|
linesList = markdown.split('\n')
|
||||||
htmlStr = ''
|
htmlStr = ''
|
||||||
ctr = 0
|
ctr = 0
|
||||||
|
titles = {
|
||||||
|
"h5": '#####',
|
||||||
|
"h4": '####',
|
||||||
|
"h3": '###',
|
||||||
|
"h2": '##',
|
||||||
|
"h1": '#'
|
||||||
|
}
|
||||||
for line in linesList:
|
for line in linesList:
|
||||||
if ctr > 0:
|
if ctr > 0:
|
||||||
htmlStr += '<br>'
|
htmlStr += '<br>'
|
||||||
if line.startswith('#####'):
|
for h, hashes in titles.items():
|
||||||
line = line.replace('#####', '').strip()
|
if line.startswith(hashes):
|
||||||
line = '<h5>' + line + '</h5>'
|
line = line.replace(hashes, '').strip()
|
||||||
ctr = -1
|
line = '<' + h + '>' + line + '</' + h + '>'
|
||||||
elif line.startswith('####'):
|
ctr = -1
|
||||||
line = line.replace('####', '').strip()
|
break
|
||||||
line = '<h4>' + line + '</h4>'
|
|
||||||
ctr = -1
|
|
||||||
elif line.startswith('###'):
|
|
||||||
line = line.replace('###', '').strip()
|
|
||||||
line = '<h3>' + line + '</h3>'
|
|
||||||
ctr = -1
|
|
||||||
elif line.startswith('##'):
|
|
||||||
line = line.replace('##', '').strip()
|
|
||||||
line = '<h2>' + line + '</h2>'
|
|
||||||
ctr = -1
|
|
||||||
elif line.startswith('#'):
|
|
||||||
line = line.replace('#', '').strip()
|
|
||||||
line = '<h1>' + line + '</h1>'
|
|
||||||
ctr = -1
|
|
||||||
htmlStr += line
|
htmlStr += line
|
||||||
ctr += 1
|
ctr += 1
|
||||||
return htmlStr
|
return htmlStr
|
||||||
|
|
Loading…
Reference in New Issue