kde5.framewoks part 2 // Tier1
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
|
||||
# Update global mime databases, mime database format may change (0.70)
|
||||
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
|
||||
os.system("/usr/bin/update-mime-database /usr/share/mime")
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import piksemel
|
||||
import os
|
||||
|
||||
def updateMimeTypes(filepath):
|
||||
parse = piksemel.parse(filepath)
|
||||
paths = set()
|
||||
for icon in parse.tags("File"):
|
||||
path = icon.getTagData("Path")
|
||||
if "/share/mime/packages/" in path and path.endswith(".xml"):
|
||||
paths.add("/%s" % path.partition("packages/")[0])
|
||||
|
||||
for p in paths:
|
||||
os.system("/usr/bin/update-mime-database %s" % p)
|
||||
|
||||
def setupPackage(metapath, filepath):
|
||||
updateMimeTypes(filepath)
|
||||
|
||||
def cleanupPackage(metapath, filepath):
|
||||
pass
|
||||
|
||||
def postCleanupPackage(metapath, filepath):
|
||||
updateMimeTypes(filepath)
|
||||
Reference in New Issue
Block a user