|
|
@ -8,9 +8,12 @@ from cryptography.fernet import Fernet
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
import uuid
|
|
|
|
import uuid
|
|
|
|
import json
|
|
|
|
import json
|
|
|
|
|
|
|
|
from os import environ
|
|
|
|
|
|
|
|
|
|
|
|
########## Paste functions ##########
|
|
|
|
########## Paste functions ##########
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.recent_pastes = int(environ["PASTEY_RECENT_PASTES"]) if "PASTEY_RECENT_PASTES" in environ else config.recent_pastes
|
|
|
|
|
|
|
|
|
|
|
|
# Get recent n pastes, defined in config by recent_pastes
|
|
|
|
# Get recent n pastes, defined in config by recent_pastes
|
|
|
|
def get_recent(limit=config.recent_pastes):
|
|
|
|
def get_recent(limit=config.recent_pastes):
|
|
|
|
paths = sorted(Path(config.data_directory).iterdir(), key=path.getmtime, reverse=True)
|
|
|
|
paths = sorted(Path(config.data_directory).iterdir(), key=path.getmtime, reverse=True)
|
|
|
|