Avoid beautifulsoup

merge-requests/6/head
Bob Mottram 2020-03-03 11:02:34 +00:00
parent cf3899b58f
commit 80066532b9
3 changed files with 10 additions and 7 deletions

View File

@ -33,9 +33,11 @@ sudo apt install -y \
python3-numpy python3-setuptools python3-crypto \
python3-dateutil python3-pil.imagetk python3-idna \
python3-requests libimage-exiftool-perl certbot nginx
sudo pip3 install beautifulsoup4 pycryptodome
sudo pip3 install pycryptodome
```
*Note*: A recent version of pycryptodome is needed because the packaged version does not include *pkcs1_15* within *Crypto.Signature*
## Installation
In the most common case you'll be using systemd to set up a daemon to run the server.

View File

@ -52,10 +52,10 @@ from auth import createBasicAuthHeader
from config import getConfigParam
from blocking import isBlocked
from filters import isFiltered
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
#try:
# from BeautifulSoup import BeautifulSoup
#except ImportError:
# from bs4 import BeautifulSoup
def isModerator(baseDir: str,nickname: str) -> bool:
"""Returns true if the given nickname is a moderator
@ -116,7 +116,8 @@ def getPersonKey(nickname: str,domain: str,baseDir: str,keyType='public', \
return keyPem
def cleanHtml(rawHtml: str) -> str:
text = BeautifulSoup(rawHtml, 'html.parser').get_text()
#text = BeautifulSoup(rawHtml, 'html.parser').get_text()
text=rawHtml
return html.unescape(text)
def getUserUrl(wfRequest: {}) -> str:

View File

@ -235,7 +235,7 @@ def followPerson(baseDir: str,nickname: str, domain: str, \
handle=nickname+'@'+domain.split(':')[0].lower()
else:
handle=nickname+'@'+domain.lower()
if not os.path.isdir(baseDir+'/accounts/'+handle):
print('WARN: account for '+handle+' does not exist')
return False