Translate desktop module to Python 3