package.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. from pisi import api as pisiapi
  4. import platform
  5. import os
  6. def postInstall(fromVersion, fromRelease, toVersion, toRelease):
  7. fileassociations = open("/usr/share/applications/mimeapps.list","a")
  8. fileassociations.write("application/pdf=evince.desktop;\n")
  9. fileassociations.write("application/zip=xarchiver.desktop;\n")
  10. fileassociations.write("application/x-rar=xarchiver.desktop;\n")
  11. fileassociations.write("application/x-compressed-tar=file-roller.desktop;\n")
  12. fileassociations.write("application/x-tar=xarhiver.desktop;\n")
  13. fileassociations.write("application/x-bzip-compressed-tar=xarchiver.desktop;\n")
  14. fileassociations.write("image/jpeg=lximage-qt5.desktop;\n")
  15. fileassociations.write("image/png=lximage-qt5.desktop;\n")
  16. fileassociations.write("image/gif=lximage-qt5.desktop;\n")
  17. fileassociations.write("image/x-ms-bmp=lximage-qt5.desktop;\n")
  18. fileassociations.write("text/plain=juffed.desktop;\n")
  19. fileassociations.write("application/x-pisi=package-manager.desktop;\n")
  20. fileassociations.close()
  21. #FIXME:
  22. try:
  23. os.unlink("/usr/share/xsessions/openbox-gnome.desktop")
  24. except:
  25. pass
  26. try:
  27. os.unlink("/usr/share/xsessions/openbox-kde.desktop")
  28. except:
  29. pass