scripts: port ext script to python2