From 66a0324d49df3e284f5b4b7d363e2ba0d15a01f5 Mon Sep 17 00:00:00 2001 From: Sunpy Date: Thu, 31 May 2018 11:23:04 +0200 Subject: [PATCH] Send sql data without wrapping --- handlers/getfile.py | 6 +----- handlers/getlist.py | 8 ++------ handlers/getupdate.py | 6 +----- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/handlers/getfile.py b/handlers/getfile.py index 2ad60d7..171bc25 100644 --- a/handlers/getfile.py +++ b/handlers/getfile.py @@ -15,11 +15,7 @@ def handle(request): if method is not None: break - output = { - "method": method_name, - "response": callback(method_name, request.args.get(method_name)) - } - return output + return callback(method_name, request.args.get(method_name)) def callback(method, data): cur = glob.sql.cursor() diff --git a/handlers/getlist.py b/handlers/getlist.py index a14b82a..7233dcd 100644 --- a/handlers/getlist.py +++ b/handlers/getlist.py @@ -15,13 +15,9 @@ def handle(request): if method is not None: break - output = { - "method": method_name, - "response": callback(method_name, request.args.get(method_name)) - } - return output + return callback(method_name) -def callback(method, data): +def callback(method): cur = glob.sql.cursor() cur.execute("SELECT {} FROM updates WHERE filename = 'osu!.exe' ORDER BY file_version".format( diff --git a/handlers/getupdate.py b/handlers/getupdate.py index f51fed0..1e5e5b9 100644 --- a/handlers/getupdate.py +++ b/handlers/getupdate.py @@ -15,11 +15,7 @@ def handle(request): if method is not None: break - output = { - "method": method_name, - "response": callback(method_name, request.args.get(method_name)) - } - return output + return callback(method_name, request.args.get(method_name)) def callback(method, data): cur = glob.sql.cursor()