[PATCH] Handle doap:category elements more correctly



---
 extract-doap-info |   10 ++++++++--
 validate-doap     |    3 ---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/extract-doap-info b/extract-doap-info
index 1bb3829..4140f4c 100755
--- a/extract-doap-info
+++ b/extract-doap-info
@@ -46,8 +46,14 @@ for node in nodes:
     print >> fd, shortdesc
     fd.close()
 
-    group = node.find_property((DOAP, "category"))
-    group = groups.get(group, 'other')
+    group = None
+    for name, lang, value in node.properties:
+        if name == (DOAP, 'category'):
+            group = groups.get (value, None)
+            if group is not None:
+                break
+    if group is None:
+        group = 'other'
     fd = open(os.path.join(git_dir, 'gnome_group'), 'w')
     print >> fd, group
     fd.close()
diff --git a/validate-doap b/validate-doap
index bf05c98..d278969 100755
--- a/validate-doap
+++ b/validate-doap
@@ -74,9 +74,6 @@ for node in nodes:
         if not is_resource(group):
             die("Invalid doap:category property (should be an URL)")
 
-        if not group in groups:
-            die("doap:category property should be one of the standard GNOME categories")
-
     have_maintainer = False
     for (n, l, v) in node.properties:
         if n == (DOAP, "maintainer"):
-- 
1.6.0.3


--=-cyFa4pj8cMjCs5Ld2EuZ--



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]