diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-03-21 09:07:59 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2013-03-21 09:18:07 +0100 |
commit | cf0816c182c2acab30b1ee9e191aff091ac41d13 (patch) | |
tree | 3f292ea5b96a867f849d4ca92703a2aef51bf75c | |
parent | dc7c26f3559be00e272c5c880f87c7550d80baae (diff) | |
download | mediagoblin-cf0816c182c2acab30b1ee9e191aff091ac41d13.tar.lz mediagoblin-cf0816c182c2acab30b1ee9e191aff091ac41d13.tar.xz mediagoblin-cf0816c182c2acab30b1ee9e191aff091ac41d13.zip |
piwigo: Add session.getStatus, improve categories.getList
- pwg.session.getStatus returns the current user as
"fake_user". When we have a session, we'll return
something better.
- pwg.categories.getList add a name and the parent id for
its one and only "collection".
- Improve logging a bit.
-rw-r--r-- | mediagoblin/plugins/piwigo/tools.py | 1 | ||||
-rw-r--r-- | mediagoblin/plugins/piwigo/views.py | 14 |
2 files changed, 10 insertions, 5 deletions
diff --git a/mediagoblin/plugins/piwigo/tools.py b/mediagoblin/plugins/piwigo/tools.py index e53d94b9..85d77310 100644 --- a/mediagoblin/plugins/piwigo/tools.py +++ b/mediagoblin/plugins/piwigo/tools.py @@ -99,6 +99,7 @@ class CmdTable(object): entry = cls._cmd_table.get(cmd_name) if not entry: return entry + _log.debug("Found method %s", cmd_name) func, only_post = entry if only_post and request.method != "POST": _log.warn("Method %s only allowed for POST", cmd_name) diff --git a/mediagoblin/plugins/piwigo/views.py b/mediagoblin/plugins/piwigo/views.py index d0629b73..6198ec6e 100644 --- a/mediagoblin/plugins/piwigo/views.py +++ b/mediagoblin/plugins/piwigo/views.py @@ -32,8 +32,6 @@ def pwg_login(request): username = request.form.get("username") password = request.form.get("password") _log.info("Login for %r/%r...", username, password) - _log.warn("login: %s %r %r", request.method, - request.args, request.form) return True @@ -45,13 +43,19 @@ def pwg_logout(request): @CmdTable("pwg.getVersion") def pwg_getversion(request): - _log.info("getversion") - return "piwigo 2.5.0" + return "piwigo 2.5.0 (MediaGoblin)" + + +@CmdTable("pwg.session.getStatus") +def pwg_session_getStatus(request): + return {'username': "fake_user"} @CmdTable("pwg.categories.getList") def pwg_categories_getList(request): - catlist = ({'id': -29711},) + catlist = ({'id': -29711, + 'uppercats': "-29711", + 'name': "All my images"},) return { 'categories': PwgNamedArray( catlist, |