mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Avoid beautifulsoup
							parent
							
								
									cf3899b58f
								
							
						
					
					
						commit
						80066532b9
					
				| 
						 | 
				
			
			@ -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.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										11
									
								
								posts.py
								
								
								
								
							
							
						
						
									
										11
									
								
								posts.py
								
								
								
								
							| 
						 | 
				
			
			@ -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:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								utils.py
								
								
								
								
							
							
						
						
									
										2
									
								
								utils.py
								
								
								
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue