# Python script that should execute before the ebuild is uninstalled (preuninst) import subprocess, sys, os print "Python MLT module uninstaller starting..." # loop through each item in the Python path list for path in sys.path: # does this contain 'site-packages' if str.lower(path).find("site-packages") > 0 or str.lower(path).find("dist-packages") > 0: print "--------------------------------------------" print "Uninstalling MLT python bindings from: %s" % path # copy the bindings into the site-packages folder subprocess.call('sudo rm %s/mlt.py' % path, shell=True) subprocess.call('sudo rm %s/_mlt.so' % path, shell=True) subprocess.call('sudo rm %s/mlt_wrap.o' % path, shell=True) # stop looping break # refresh shared libraries subprocess.call('sudo ldconfig', shell=True) print "Python MLT module uninstall successfully completed!"