pakhandler.py 555 B

123456789101112131415161718192021222324
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. import piksemel
  4. import os
  5. def updateData(filepath):
  6. parse = piksemel.parse(filepath)
  7. for icon in parse.tags("File"):
  8. path = icon.getTagData("Path")
  9. if path.startswith("usr/lib/gdk-pixbuf-2.0/2.10.0/loaders"):
  10. os.system("/usr/bin/gdk-pixbuf-query-loaders --update-cache")
  11. return
  12. def setupPackage(metapath, filepath):
  13. updateData(filepath)
  14. def cleanupPackage(metapath, filepath):
  15. pass
  16. def postCleanupPackage(metapath, filepath):
  17. updateData(filepath)