Update desktop module for Python 3

Shamelessly ripped from @revolunet's markdown preview package.
Fix bad relative import of desktop module