pakhandler.py 516 B

12345678910111213141516171819202122
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. import piksemel
  4. import os
  5. import fnmatch
  6. def updateData(filepath):
  7. parse = piksemel.parse(filepath)
  8. for icon in parse.tags("File"):
  9. path = icon.getTagData("Path")
  10. if path.startswith("usr/share/icons/hicolor"):
  11. os.system("/usr/bin/gtk3-update-icon-cache -f /usr/share/icons/hicolor")
  12. break
  13. def setupPackage(metapath, filepath):
  14. updateData(filepath)
  15. def postCleanupPackage(metapath, filepath):
  16. updateData(filepath)