activity.py: Fix all pyflakes and pep-8 warnings

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>