Userscript installation and updater

This commit is contained in:
Ruud
2011-10-16 19:36:38 +02:00
parent 00f819b4f1
commit e8ae2dced0
11 changed files with 134 additions and 67 deletions
+7 -3
View File
@@ -2,6 +2,7 @@ from couchpotato.core.helpers.variable import natcmp
from flask.globals import current_app
from flask.helpers import json
from libs.werkzeug.urls import url_decode
from urllib import unquote_plus
import flask
import re
@@ -24,7 +25,7 @@ def getParams():
for item in nested:
if item is nested[-1]:
current[item] = value
current[item] = unquote_plus(value)
else:
try:
current[item]
@@ -33,7 +34,7 @@ def getParams():
current = current[item]
else:
temp[param] = value
temp[param] = unquote_plus(value)
return dictToList(temp)
@@ -54,7 +55,10 @@ def dictToList(params):
return new
def getParam(attr, default = None):
return getattr(flask.request, 'args').get(attr, default)
try:
return unquote_plus(getattr(flask.request, 'args').get(attr, default))
except:
return None
def padded_jsonify(callback, *args, **kwargs):
content = str(callback) + '(' + json.dumps(dict(*args, **kwargs)) + ')'