Skip to content
Snippets Groups Projects
Commit 9360cd17 authored by Jonas Leder's avatar Jonas Leder
Browse files

edid some coments

parent 78aa1cdc
Branches
Tags
No related merge requests found
......@@ -23,10 +23,10 @@ try:
if(os.environ["show_build_date"] == "1"): #If you want to see the builddate you can enable this enviorement variable
builddate = ", Build date: " + open("builddate.txt", "r").read()
except:
pass #This normaly only happens, if the script runs without a container for testing.
pass #This exception is only to pass it while testing
try:
if(os.environ["production"] == "1"): #If you disable production the flask testserver will be used, because it makes more debug output
if(os.environ["production"] == "1"): #If you use this in production, please set this to 1, because the Flask Testserver is not very secure
production = True
else:
production = False
......@@ -57,16 +57,16 @@ def table_check():
def makeQR(text): #This function is used to create a QR code and encode it base64, if you make a new shortlink
qr = qrcode.QRCode(
qr = qrcode.QRCode( #QR generation variables
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=1,
)
qr.add_data(text)
qr.make(fit=True)
qr.add_data(text) #The URL is in the text variable
qr.make(fit=True) #Generate the QR
img = qr.make_image(fill_color="black", back_color="white")
img = qr.make_image(fill_color="black", back_color="white") #Encode the WR as base 64
with BytesIO() as buffer:
img.save(buffer, 'jpeg')
return base64.b64encode(buffer.getvalue()).decode()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment