MCPcopy Index your code
hub / github.com/pyload/pyload / pre_processor

Function pre_processor

module/web/pyload_app.py:43–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41# Helper
42
43def pre_processor():
44 s = request.environ.get('beaker.session')
45 user = parse_userdata(s)
46 perms = parse_permissions(s)
47 status = {}
48 captcha = False
49 update = False
50 plugins = False
51 if user["is_authenticated"]:
52 status = PYLOAD.statusServer()
53 info = PYLOAD.getInfoByPlugin("UpdateManager")
54 captcha = PYLOAD.isCaptchaWaiting()
55
56 # check if update check is available
57 if info:
58 if info["pyload"] == "True": update = True
59 if info["plugins"] == "True": plugins = True
60
61
62 return {"user": user,
63 'status': status,
64 'captcha': captcha,
65 'perms': perms,
66 'url': request.url,
67 'update': update,
68 'plugins': plugins}
69
70
71def base(messages):

Callers

nothing calls this directly

Calls 6

parse_userdataFunction · 0.90
parse_permissionsFunction · 0.90
getMethod · 0.45
statusServerMethod · 0.45
getInfoByPluginMethod · 0.45
isCaptchaWaitingMethod · 0.45

Tested by

no test coverage detected