a few pylint, pyflakes and pychecker messages

I put also a few ??? where I did not understand some messages.
use xdg module instead of hand writing the xdg logic