incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [2/9] git commit: [#7208] ticket:549 Add maintainers and developers to DOAP
Date Wed, 12 Mar 2014 20:48:00 GMT
[#7208] ticket:549 Add maintainers and developers to DOAP


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f92fa76e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f92fa76e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f92fa76e

Branch: refs/heads/master
Commit: f92fa76e778a4f5e11785b46d5da7a1388dc8acc
Parents: ba275b9
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Wed Feb 26 12:30:38 2014 +0200
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed Mar 12 20:47:54 2014 +0000

----------------------------------------------------------------------
 Allura/allura/model/project.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f92fa76e/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 3c9c385..a5a7816 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -999,6 +999,7 @@ class Project(MappedClass, ActivityNode, ActivityObject):
             'rdf:about': "http://sourceforge.net/api/project/name/vivo/doap#",
         })
         root << p
+        # Basic fields
         p << Node('name', self.name)
         p << Node('sf:shortname', self.shortname)
         p << Node('sf:id', str(self._id))
@@ -1009,6 +1010,7 @@ class Project(MappedClass, ActivityNode, ActivityObject):
         if self.external_homepage:
             p << Node('homepage', **{'rdf:resource': self.external_homepage})
 
+        # Categories
         for cat in TroveCategory.query.find({'_id': {'$in': self.trove_audience}}):
             p << Node('audience', cat.fullname)
         for cat in TroveCategory.query.find({'_id': {'$in': self.trove_os}}):
@@ -1035,11 +1037,34 @@ class Project(MappedClass, ActivityNode, ActivityObject):
         for cat in TroveCategory.query.find({'_id': {'$in': all_troves}}):
             p << Node('category', **{'rdf:resource': 'http://sourceforge.net/api/trove/index/rdf#%s'
% cat.trove_cat_id})
 
+        # Awards
         for a in self.accolades:
             award = Node('beer:Award')
             award << Node('beer:awardCategory', a.award.full)
             award << Node('beer:awardedAt', a.granted_by_neighborhood.name)
             p << (Node('sf:awarded') << award)
+
+        # Maintainers
+        for u in self.admins():
+            person = Node('foaf:Person', **{
+                'xmlns:foaf': "http://xmlns.com/foaf/0.1/",
+                'xmlns:rdf': "http://www.w3.org/1999/02/22-rdf-syntax-ns#"})
+            person << Node('foaf:name', u.display_name)
+            person << Node('foaf:nick', u.username)
+            person << Node('foaf:homepage', **{'rdf:resource': h.absurl(u.url())})
+            p << (Node('maintainer') << person)
+
+        # Developers
+        devs = [u for u in self.users_with_role('Developer') if u not in self.admins()]
+        for u in devs:
+            person = Node('foaf:Person', **{
+                'xmlns:foaf': "http://xmlns.com/foaf/0.1/",
+                'xmlns:rdf': "http://www.w3.org/1999/02/22-rdf-syntax-ns#"})
+            person << Node('foaf:name', u.display_name)
+            person << Node('foaf:nick', u.username)
+            person << Node('foaf:homepage', **{'rdf:resource': h.absurl(u.url())})
+            p << (Node('developer') << person)
+
         return root.render(as_root=True)
 
 


Mime
View raw message