[sysadmin-bin] show programming language in the owner column



commit 6d5d090e839f6e9b3194538df0002c005a412897
Author: Olav Vitters <olav vitters nl>
Date:   Thu Jul 31 05:11:06 2014 +0200

    show programming language in the owner column

 git/build-repo-list |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/git/build-repo-list b/git/build-repo-list
index 87f1a1b..18a7160 100755
--- a/git/build-repo-list
+++ b/git/build-repo-list
@@ -42,6 +42,7 @@ class Repo:
     def __init__(self, repopath):
         self.path = repopath
         self.pending = os.path.isfile(os.path.join(repopath, 'pending'))
+        self.owner = ''
 
         shortname = re.sub('/git/', '', repopath)
         shortname = re.sub('/srv/', '', shortname)
@@ -67,6 +68,13 @@ class Repo:
             section = open(section_file).readline().strip()
         self.section = sectionmap.get(section, 'Other')
 
+        prog_file = os.path.join(repopath, 'programming-language')
+        prog = []
+        if os.path.isfile(prog_file):
+            prog = open(prog_file).read().splitlines()
+        # pretend owner == programming languages
+        self.owner = ", ".join(prog)
+
 # Sort alphabetically by name
 def sort_repos(a, b):
     return cmp(a.shortname, b.shortname)
@@ -102,6 +110,7 @@ def output_cgit(repo):
     print 'repo.section=%s' % repo.section
     print 'repo.name=%s' % repo.shortname
     print 'repo.desc=%s' % repo.desc
+    print 'repo.owner=%s' % repo.owner
     print 'repo.path=%s' % repo.path
     print
 


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