aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-François Rameau <jframeau@cvs.gnome.org>2005-03-25 19:55:54 +0800
committerJean-François Rameau <jframeau@src.gnome.org>2005-03-25 19:55:54 +0800
commita4f1b2a2fea6fb5f254e44c94cfe71cb41743ecf (patch)
tree7d92cc0bbb522142b8f6871377def92152e2b89a
parent5a3efe95b1e8d87f406aa0114d95d64e0a02203f (diff)
downloadgsoc2013-epiphany-a4f1b2a2fea6fb5f254e44c94cfe71cb41743ecf.tar.gz
gsoc2013-epiphany-a4f1b2a2fea6fb5f254e44c94cfe71cb41743ecf.tar.zst
gsoc2013-epiphany-a4f1b2a2fea6fb5f254e44c94cfe71cb41743ecf.zip
data/check-mime.py
2005-03-25 Jean-François Rameau <jframeau@cvs.gnome.org> * data/check-mime.py Set the script directly executable. Fix problem with args. Add a message if no arg is supplied.
-rw-r--r--ChangeLog8
-rwxr-xr-xdata/check-mime.py12
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d1e3845d4..b7182c3e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-03-25 Jean-François Rameau <jframeau@cvs.gnome.org>
+
+ * data/check-mime.py
+
+ Set the script directly executable.
+ Fix problem with args.
+ Add a message if no arg is supplied.
+
2005-03-24 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/ContentHandler.cpp:
diff --git a/data/check-mime.py b/data/check-mime.py
index 59d1d3383..db87484f1 100755
--- a/data/check-mime.py
+++ b/data/check-mime.py
@@ -1,12 +1,20 @@
+#!/usr/bin/env python
+
from xml.dom.minidom import parse, Node, Document, parseString
import xml.parsers.expat
import os
import sys
-base = sys.argv[0]
+try:
+ base = sys.argv[1]
+except IndexError:
+ print "\nYou shoud give the full path to freedesktop.org.xml file"
+ print "e.g /usr/share/mime/packages/freedesktop.org.xml\n"
+ sys.exit (1)
+
dbfile = os.path.join(os.path.dirname(base), "freedesktop.org.xml")
-permissionfile = os.path.join(os.path.dirname(base), "mime-types-permissions.xml")
+permissionfile = "mime-types-permissions.xml"
def PrintIfAbsent(elements, elem):
for elem2 in elements: