Rewrite mysphinx.py