~metalune/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH] simplytranslate_web: Adding Cookies

Details
Message ID
<AM9P191MB152205288F65C6E1B3D982BCDFF39@AM9P191MB1522.EURP191.PROD.OUTLOOK.COM>
DKIM signature
pass
Download raw message
Patch: +13 -1
---
 main.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/main.py b/main.py
index 930fbad..f25f2ac 100644
--- a/main.py
+++ b/main.py
@@ -1,4 +1,5 @@
from quart import Quart, render_template, request, redirect
from os import urandom
from quart import Quart, render_template, request, redirect, session
from configparser import ConfigParser
from urllib.parse import urlencode

@@ -34,6 +35,8 @@ if not engines:

app = Quart(__name__)

app.secret_key = urandom(30)

@app.route(
    "/translate/<string:from_language>/<string:to_language>/<string:input_text>/"
)
@@ -129,6 +132,12 @@ async def index():
        from_lang = to_full_name(request.args.get("sl", "auto"), engine)

        to_lang = to_full_name(request.args.get("tl", "en"), engine)

        if session.get('from_language'):
            from_lang = session['from_language']
        if session.get('to_language'):
            to_lang = session['to_language']

    elif request.method == "POST":
        form = await request.form

@@ -138,6 +147,9 @@ async def index():

        to_lang = form.get("to_language", "English")

        session['from_language'] = from_lang
        session['to_language'] = to_lang

    from_l_code = None
    to_l_code = None

-- 
2.25.1
Details
Message ID
<CDE4XDT13JCY.2ETDYNNRDO55O@thinkpad>
In-Reply-To
<AM9P191MB152205288F65C6E1B3D982BCDFF39@AM9P191MB1522.EURP191.PROD.OUTLOOK.COM> (view parent)
DKIM signature
pass
Download raw message
Thank you a lot for this contribution
Details
Message ID
<AM9P191MB1522DC87CDBE9B3569B0D639DFF59@AM9P191MB1522.EURP191.PROD.OUTLOOK.COM>
In-Reply-To
<CDE4XDT13JCY.2ETDYNNRDO55O@thinkpad> (view parent)
DKIM signature
pass
Download raw message
:)
Reply to thread Export thread (mbox)