From 9360cd17c16882b482475c6b43861b74ec5480f3 Mon Sep 17 00:00:00 2001
From: jonasled <jonas@jonasled.de>
Date: Sat, 19 Oct 2019 11:38:30 +0200
Subject: [PATCH] edid some coments

---
 main.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/main.py b/main.py
index be287dc..05fbf3f 100644
--- a/main.py
+++ b/main.py
@@ -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()
-- 
GitLab