[Sourcebo-commits] jlbec commits r82 - in trunk: . lib/sourcebo lib/sourcebo/configfile

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Nov 17 10:38:58 CST 2005


Author: jlbec
Date: 2005-11-17 10:38:57 -0600 (Thu, 17 Nov 2005)
New Revision: 82

Added:
   trunk/sb_main_index
   trunk/sb_pre_commit_src
Modified:
   trunk/lib/sourcebo/configfile/config.py
   trunk/lib/sourcebo/configfile/stanza.py
   trunk/lib/sourcebo/projects.py
   trunk/sb_co_content
   trunk/sb_create
   trunk/sb_cvs_mirror
   trunk/sb_gen_index
   trunk/sb_post_commit_content
   trunk/sb_post_commit_src
   trunk/sb_project_index
   trunk/sb_push_content
   trunk/sb_queue_manager
   trunk/sb_regen_all
Log:

o Commit various cleanups from Manish, including moving to python2.4
o Add 'indexed' to project.desc.  If 'indexed = false', don't put the
  project in the project list.



Modified: trunk/lib/sourcebo/configfile/config.py
===================================================================
--- trunk/lib/sourcebo/configfile/config.py	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/lib/sourcebo/configfile/config.py	2005-11-17 16:38:57 UTC (rev 82)
@@ -35,15 +35,11 @@
         self.stanzas = {}
 
     def stanza_names(self):
-        """Returns the list of known stanza names"""
-        return self.stanzas.keys()
-
-    def iter_stanza_names(self):
-        """Returns an interator over the known stanza names"""
+        """Returns an iterator over the known stanza names"""
         return self.stanzas.iterkeys()
 
     def get_stanzas(self, s_name, **search):
-        """Returns the list of all matching s_name stanzas"""
+        """Returns an iterator for all s_name stanzas"""
         try:
             val = self.stanzas[s_name]
             if len(search) > 0:
@@ -52,10 +48,10 @@
                     for a, v in search.items():
                         if s.get(a) == v:
                             res.append(s)
-                return res
+                return iter(res)
         except KeyError:
             val = []
-        return val
+        return iter(val)
 
     def add_stanza(self, s_name):
         """Adds a stanza named s_name to the config"""
@@ -84,7 +80,8 @@
 
     def dump_memory(self):
         """Writes the config to a String and returns it"""
-        str = StringIO.StringIO()
+        str = StringIO.StringIO("")
+        str.name = "<memory>"
         self.dump(str)
         ret = str.getvalue()
         str.close()
@@ -93,15 +90,16 @@
     def parse_file(self, filename):
         """Parses a config file from disk"""
         fd = open(filename, "r")
-        self.parse(fd, fd.name)
+        self.parse(fd)
 
     def parse_memory(self, data):
         """Parses a config file from memory"""
         str = StringIO.StringIO(data);
-        self.parse(str, '<memory>');
+        str.name = "<memory>"
+        self.parse(str);
         str.close();
         
-    def parse(self, fd, src_name):
+    def parse(self, fd):
         """Parses a config file from the file object"""
         line = 0
         multi = 0
@@ -143,18 +141,18 @@
                     cur_class = m.group(1)
                     cur_stanza = self.add_stanza(cur_class)
                 else:
-                    print "Invalid class name at line %d of %s." % (line, src_name)
+                    print "Invalid class name at line %d of %s." % (line, fd.name)
                 continue
 
             # Anything else is a field value
             if cur_class == "":
-                print "Field without valid class name at line %d of %s." % (line, src_name)
+                print "Field without valid class name at line %d of %s." % (line, fd.name)
                 continue
 
             m = re.compile(r"^\s+([\w_]+)\s*=\s*(.*)\s*$").search(l)
             if m == None:
                 print "Invalid field specification at line %d of %s." \
-                    % (line, src_name)
+                    % (line, fd.name)
                 continue
             field = m.group(1)
             value = m.group(2)

Modified: trunk/lib/sourcebo/configfile/stanza.py
===================================================================
--- trunk/lib/sourcebo/configfile/stanza.py	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/lib/sourcebo/configfile/stanza.py	2005-11-17 16:38:57 UTC (rev 82)
@@ -20,7 +20,6 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
 
-import re
 
 class Stanza:
     def __init__(self, s_name):
@@ -47,14 +46,10 @@
         """Removes the attribute a_name from the stanza"""
         del self.attributes[a_name]
 
-    def iter_attribute_names(self):
+    def attribute_names(self):
         """Returns an iterator over the names of the Stanza's attributes"""
         return self.attributes.iterkeys()
 
-    def attribute_names(self):
-        """Returns the names of the Stanza's attributes"""
-        return self.attributes.keys()
-
     def dump(self, fd):
         """Prints out the stanza for permanent storage"""
         # Make sure to handle multiline later

Modified: trunk/lib/sourcebo/projects.py
===================================================================
--- trunk/lib/sourcebo/projects.py	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/lib/sourcebo/projects.py	2005-11-17 16:38:57 UTC (rev 82)
@@ -54,6 +54,12 @@
         if not de:
             de = 'none'
 
+        indexed = s.get("indexed")
+        if not indexed:
+            indexed = "true"
+        elif indexed not in ("true", "false"):
+            raise SourceboError('Invalid value for "indexed"')
+
         licenses = []
         for s in c.get_stanzas("license"):
             lic = s.get("name")
@@ -61,6 +67,12 @@
             if lic:
                 licenses.append(lic.upper())
 
+            else:
+                lic = s.get("custom")
+
+                if lic:
+                    licenses.append((lic,))
+
         if len(licenses) == 0:
             licenses.append('GPL')
 
@@ -71,6 +83,7 @@
 
     conf['projecttitle'] = ti
     conf['projectdesc'] = de
+    conf['projectindexed'] = indexed
     conf['projectlicenses'] = licenses
 
 
@@ -97,16 +110,29 @@
 
         desc = os.path.join(projectdir, 'home', 'project.desc')
         parse_project_description(info, desc)
+        if info['projectindexed'] != "true":
+            continue
 
         projects.append(info)
 
+    def sort_title(a, b):
+        return cmp(a['projecttitle'].lower(), b['projecttitle'].lower())
+
+    projects.sort(sort_title)
+
     return projects
 
-project_list_template = """<tr bgcolor="#e7e7ef" style="">
-<td width="100%%" height="100%%" bgcolor="#e6e7e8"><a class="OffTab2"
-href="/projects/%(project)s/">%(projecttitle)s</a></td><td></td></tr>
+project_list_template = """<tr summary="" style="CURSOR: hand"
+onclick="window.location='/projects/%(project)s/'" bgcolor="#e6e7e8">
+<td><a class="navlink" href="/projects/%(project)s/">%(projecttitle)s</a></td>
+</tr>
 """
 
+#project_list_template = """<tr bgcolor="#e7e7ef" style="">
+#<td width="100%%" height="100%%" bgcolor="#e6e7e8"><a class="OffTab2"
+#href="/projects/%(project)s/">%(projecttitle)s</a></td><td></td></tr>
+#"""
+
 #project_list_template = """<TR CLASS="SBPROJECT">
 #<TD WIDTH="100%%" CLASS="SBPROJECT">
 #<A HREF="/projects/%(project)s/">%(projecttitle)s</A>

Modified: trunk/sb_co_content
===================================================================
--- trunk/sb_co_content	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_co_content	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 # Sourcebo - A collaborative development system
 #

Modified: trunk/sb_create
===================================================================
--- trunk/sb_create	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_create	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 # Sourcebo - A collaborative development system
 #
@@ -82,7 +82,7 @@
 REPOS="$1"
 REV="$2"
 
-sb_post_commit_%(type)s %(project)s "$REPOS" "$REV"
+sb_%(hooktype)s_commit_%(repo)s %(project)s "$REPOS" "$REV"
 """
 
 def mkdir(dir):
@@ -195,10 +195,14 @@
         run('touch %s' % fname)
 
 def mailman():
+    base = os.path.join(conf['mailmanpath'], 'lists')
+
     for i in ('announce', 'users', 'devel', 'commits'):
-        run("newlist -q %s-%s admin@%s foobar" % (conf['project'], i,
-                                                  conf['mailname']))
+        name = '%s-%s' % (conf['project'], i)
 
+        if not os.access(os.path.join(base, name, 'config.pck'), os.F_OK):
+            run("newlist -q %s admin@%s foobar" % (name, conf['mailname']))
+
 def bugzilla():
     pass
 
@@ -214,18 +218,25 @@
     for cf in apache, mailman, bugzilla:
         cf()
 
+def write_hook(repo, hooktype):
+    fname = os.path.join(conf[repo + 'path'], 'hooks', hooktype + '-commit')
+
+    if not os.access(fname, os.F_OK):
+        info = conf.copy()
+        info['repo'] = repo
+        info['hooktype'] = hooktype
+
+        desc = "%s %s commit hooks" % (repo, hooktype)
+        write(fname, desc, commit_template, info)
+
+    os.chmod(fname, 0755)
+
 def hooks():
     for i in ('src', 'content'):
-        fname = os.path.join(conf[i + 'path'], 'hooks', 'post-commit')
+        write_hook(i, 'post')
 
-        if not os.access(fname, os.F_OK):
-            info = conf.copy()
-            info['type'] = i
+    write_hook('src', 'pre')
 
-            write(fname, i + " commit hooks", commit_template, info)
-
-        os.chmod(fname, 0755)
-
 def prep():
     os.chdir(conf['projectpath'])
 

Modified: trunk/sb_cvs_mirror
===================================================================
--- trunk/sb_cvs_mirror	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_cvs_mirror	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 # Sourcebo - A collaborative development system
 #

Modified: trunk/sb_gen_index
===================================================================
--- trunk/sb_gen_index	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_gen_index	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 # Sourcebo - A collaborative development system
 #
@@ -37,7 +37,7 @@
 
 from sourcebo.errors import *
 
-import sourcebo.configfile as configfile
+import sourcebo.configfile.config
 
 
 class SBFile(object):
@@ -228,7 +228,7 @@
         desc = filename + ".desc"
         log.out('Reading description "%s"' % desc, 2)
 
-        c = configfile.config.Config()
+        c = sourcebo.configfile.config.Config()
 
         try:
             c.parse_file(os.path.join(self.path, desc))
@@ -289,25 +289,11 @@
 
             self.read_file(base)
             
-project_list_template = """<tr bgcolor="#e7e7ef" style="">
-<td width="100%%" height="100%%" bgcolor="#e6e7e8"><a class="OffTab2"
-href="/projects/%(project)s/">%(projecttitle)s</a></td><td></td></tr>
-"""
-
-def get_project_list():
-    """Build the project sidebar"""
-    global plist
-
-    if not plist:
-        for p in sourcebo.projects.get_project_descriptions(conf):
-            plist += project_list_template % p
-
-    return plist
-
 def get_nav_bar():
     """Build a navigation bar for the specified table"""
 
     bugpath = "/bugzilla/buglist.cgi?product=%s" % conf['projecttitle']
+    bugpath += "&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=NEEDINFO"
 
     htmlconf = conf['htmlconfig'].copy()
     htmlconf['bugpath'] = bugpath
@@ -319,19 +305,19 @@
 [
 </TD>
 <TD CLASS="SBNAV" NOWRAP>
-<A HREF="%(projectpath)s">Project Home</A>
+<A HREF="%(projectpath)s/">Project Home</A>
 </TD>
 <TD CLASS="SBNAV">&nbsp;|&nbsp;</TD>
 <TD CLASS="SBNAV" NOWRAP>
-<A HREF="%(newspath)s">News</A>
+<A HREF="%(newspath)s/">News</A>
 </TD>
 <TD CLASS="SBNAV">&nbsp;|&nbsp;</TD>
 <TD CLASS="SBNAV" NOWRAP>
-<A HREF="%(filepath)s">Files</A>
+<A HREF="%(filepath)s/">Downloads</A>
 </TD>
 <TD CLASS="SBNAV">&nbsp;|&nbsp;</TD>
 <TD CLASS="SBNAV" NOWRAP>
-<A HREF="%(docpath)s">Docs</A>
+<A HREF="%(docpath)s/">Docs</A>
 </TD>
 <TD CLASS="SBNAV">&nbsp;|&nbsp;</TD>
 <TD CLASS="SBNAV" NOWRAP>
@@ -339,7 +325,7 @@
 </TD>
 <TD CLASS="SBNAV">&nbsp;|&nbsp;</TD>
 <TD CLASS="SBNAV" NOWRAP>
-<A HREF="%(projectpath)s/source.html">Source</A>
+<A HREF="%(projectpath)s/source.html">Source&nbsp;Control</A>
 </TD>
 <TD CLASS="SBNAV">&nbsp;|&nbsp;</TD>
 <TD CLASS="SBNAV" NOWRAP>
@@ -385,7 +371,7 @@
     if d.get_parent():
         back_title = '%s: <A HREF="..">Back to %s</A>' % (d.get_title(), d.get_parent().get_title())
     else:
-        back_title = "[Files Top]\n"
+        back_title = "[Downloads Top]\n"
 
     text += """
 <TR STYLE="font-size:smaller; text-align:left;">
@@ -523,9 +509,9 @@
     template_file = os.path.join(conf['templatepath'], "files.html")
     t = sourcebo.template.Template(template_file)
 
-    t.set("title", "Project Files: %s" % conf['projecttitle'])
+    t.set("title", "Project Downloads: %s" % conf['projecttitle'])
 
-    t.set("projects", get_project_list())
+    t.set("projects", sourcebo.projects.get_project_list_html(conf))
 
     top = scan_dir(conf['filepath'])
 
@@ -533,7 +519,7 @@
     while dirs:
         d = dirs.pop(0)
         dirs.extend(d.get_subdirs())
-        d.sort_mtime()
+        d.sort_name()
 
         outpath = os.path.join(d.get_path().replace(conf["projectpath"],
                                                     conf["stagingpath"]),
@@ -558,7 +544,7 @@
                                                 "documentation.html"))
     t.set("title", "Project Documentation: %s" % conf['projecttitle'])
 
-    t.set("projects", get_project_list())
+    t.set("projects", sourcebo.projects.get_project_list_html(conf))
 
     top = scan_dir(conf['docpath'])
 
@@ -591,7 +577,7 @@
                                                 "news.html"))
     t.set("title", "Project News: %s" % conf['projecttitle'])
 
-    t.set("projects", get_project_list())
+    t.set("projects", sourcebo.projects.get_project_list_html(conf))
 
     top = scan_dir(conf['newspath'])
                    
@@ -703,7 +689,7 @@
     t.set("content", sourcetext)
     t.set("title", "Project Mailing Lists: %s" % conf['projecttitle'])
 
-    t.set("projects", get_project_list())
+    t.set("projects", sourcebo.projects.get_project_list_html(conf))
 
     try:
         outpath = os.path.join(conf['listpath'].replace(conf['projectpath'], conf["stagingpath"]), "index.html")
@@ -740,13 +726,13 @@
 <UL>
 <P>
 <LI>
-<A HREF="%(srcpath)s">Browse</A>
+<A HREF="%(srcpath)s/">Browse</A>
 source code on-line to view this project's directory structure and
 files.
 </LI>
 <BR><BR>
 <LI>
-<A HREF="%(filepath)s">Download</A> source
+<A HREF="%(filepath)s/">Download</A> source
 code archives, if any are available, to copy read-only source files
 for this project on to your local system.
 </LI>
@@ -756,9 +742,10 @@
 </LI>
 <BR><BR>
 <LI>
-You can use Subversion to check out your own working copies of project
-source code files.  Subversion is an open source version control for
-keeping track of all modifications to project source code files.
+You can use <A HREF="http://subversion.tigris.org/">Subversion</A> to
+check out your own working copies of project source code files.
+Subversion is an open source version control for keeping track of all
+modifications to project source code files.
 <P>
 <B>Important note:</B> The following instructions cover checking out
 from Subversion for a read-write copy.  You must have been granted
@@ -773,16 +760,18 @@
 You can check out a working copy with:
 <P>
 <BLOCKQUOTE>
-           <B>svn checkout --username &lt;user&gt; http://%(webname)s/%(srcpath)s &lt;dir&gt;</B><BR><BR>
+           <B>svn checkout http://%(webname)s%(srcpath)s/trunk/ &lt;dir&gt;</B><BR><BR>
 </BLOCKQUOTE>
-Where <B>&lt;user&gt;</B> is the username you have been given in the
-Subversion repository and <B>&lt;dir&gt;</B> is the working directory
-to place the tree in.
+Where <B>&lt;dir&gt;</B> is the working directory to place the tree in.
 <P>
 This command should result in a scrolling list of files being added to the local directory you specified on your machine. Now you are ready to use your file viewer to work with individual files.
 </LI>
 <BR><BR>
 <LI>
+In the future, there will be a read-only CVS mirror of the source repository,
+but right now it is not enabled, so please use Subversion.
+<!--
+<LI>
 You can use CVS to check out your own read-only copies of project
 source code files.  CVS is an open source version control for keeping
 track of all modifications to project source code files. You can
@@ -848,6 +837,7 @@
 <LI>Enter project module name and click OK. You should see a scrolling list of filenames as these are created in your folder(s).
 <P>
 <LI>Repeat the module creation process for each additional cvs module you wish to check out.
+-->
 </OL>
 </UL>
 
@@ -857,9 +847,9 @@
 """ % htmlconf
 
     t.set("content", sourcetext)
-    t.set("title", "Project Source: %s" % conf['projecttitle'])
+    t.set("title", "Project Source Control: %s" % conf['projecttitle'])
 
-    t.set("projects", get_project_list())
+    t.set("projects", sourcebo.projects.get_project_list_html(conf))
 
     try:
         outpath = os.path.join(conf["stagingpath"], "source.html")
@@ -874,7 +864,10 @@
 valid_licenses = {
   'GPL': 'http://www.gnu.org/licenses/gpl.html',
   'LGPL': 'http://www.gnu.org/licenses/lgpl.html',
-  'FDL': 'http://www.gnu.org/licenses/fdl.html'
+  'FDL': 'http://www.gnu.org/licenses/fdl.html',
+  'BSD': 'http://www.debian.org/misc/bsd.license',
+  'MPL': 'http://www.mozilla.org/MPL/',
+  'Artistic': 'http://www.perl.com/pub/a/language/misc/Artistic.html'
 }
 
 def scan_home():
@@ -884,12 +877,15 @@
 
     licensetext = []
     for license in conf['projectlicenses']:
-        try:
-            licensetext.append('<a href="%s">%s</a>' % (valid_licenses[license],
-                                                        license))
-        except KeyError:
-            log.err("Invalid license: %s" % license)
-            return 1
+        if isinstance(license, tuple):
+            licensetext.append(license[0])
+        else:
+            try:
+                licensetext.append('<a href="%s">%s</a>' % (valid_licenses[license],
+                                                            license))
+            except KeyError:
+                log.err("Invalid license: %s" % license)
+                return 1
 
     info['licensetext'] = ', '.join(licensetext)
 
@@ -953,7 +949,7 @@
     t.set("content", hometext)
     t.set("title", "Project: %s" % conf['projecttitle'])
 
-    t.set("projects", get_project_list())
+    t.set("projects", sourcebo.projects.get_project_list_html(conf))
 
     htmlconf = conf['htmlconfig']
     for k, v in htmlconf.items():
@@ -985,7 +981,7 @@
 def main(argv):
     """Main function"""
 
-    global conf, log, plist
+    global conf, log
 
     ret = 0
 
@@ -993,8 +989,6 @@
 
     parselocal(remain)
 
-    plist = ''
-
     ret += scan_files()
     ret += scan_documentation()
     ret += scan_news()

Added: trunk/sb_main_index
===================================================================
--- trunk/sb_main_index	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_main_index	2005-11-17 16:38:57 UTC (rev 82)
@@ -0,0 +1,92 @@
+#!/usr/bin/env python2.4
+
+# Sourcebo - A collaborative development system
+#
+# sb_project_index
+#
+# Generates the global project index.
+#
+# Copyright (C) 2002, 2003 Oracle Corporation, Joel Becker
+# <joel.becker at oracle.com> and Manish Singh <manish.singh at oracle.com>
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+
+import sys
+import os
+
+import sourcebo.config
+import sourcebo.template
+import sourcebo.projects
+
+from sourcebo.errors import *
+
+project_list_template = """<tr summary="" style="CURSOR: hand"
+onclick="window.location='/projects/%(project)s/'" bgcolor="#e6e7e8">
+<td><a class="navlink" href="/projects/%(project)s/">%(projecttitle)s</a></td>
+</tr>
+"""
+
+desc_template = """<tr>
+<td bgcolor="white"><span class="bodycopy">
+<a href="/projects/%(project)s/" class="bodylink">%(projecttitle)s</a></span>
+</td>
+<td bgcolor="white"><span class="bodycopy">
+%(projectdesc)s</span>
+</td>
+</tr>
+"""
+
+def main(argv):
+    global conf, log
+
+    conf, remain, log = sourcebo.config.setup(argv, project=False)
+
+    t = sourcebo.template.Template(os.path.join(conf['templatepath'],
+                                                "site.html"))
+
+    t.set("projects", sourcebo.projects.get_project_list_html(conf))
+
+    descs = sourcebo.projects.get_project_descriptions(conf)
+
+    desc_table = """<table width="100%" bgcolor="gray" border=0 cellpadding=0 cellspacing=1><tr><td>
+<table width="100%" cellpadding=1 cellspacing=1 border=0>
+<tr>
+<td bgcolor="white"><span class="bodycopy">
+<span class="boldbodycopy">Title</span> </td>
+</td>
+<td bgcolor="white"><span class="bodycopy">
+<span class="boldbodycopy">Description</span>
+</td>
+</tr>
+"""
+
+    for d in descs:
+        desc_table += desc_template % d
+
+    desc_table += '</table>\n</td></tr></table>\n'
+
+    t.set("descriptions", desc_table)
+
+    outpath = "/home/sourcebo/docroot/index.html"
+
+    try:
+        t.output(outpath)
+    except IOError, e:
+        log.bail('Unable to write "%s": %s' % (outpath, e))
+
+# Start
+if __name__ == "__main__":
+    main(sys.argv)


Property changes on: trunk/sb_main_index
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/sb_post_commit_content
===================================================================
--- trunk/sb_post_commit_content	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_post_commit_content	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 import os
 import sys
@@ -13,7 +13,7 @@
     try:
         conf['repos'], conf['rev'] = remain[0:2]
     except ValueError:
-        log.bail("Invalid args (should only be called internally")
+        log.bail("Invalid args (should only be called internally)")
 
 def main(argv):
     global conf, log

Modified: trunk/sb_post_commit_src
===================================================================
--- trunk/sb_post_commit_src	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_post_commit_src	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 import os
 import sys
@@ -13,7 +13,7 @@
     try:
         conf['repos'], conf['rev'] = remain[0:2]
     except ValueError:
-        log.bail("Invalid args (should only be called internally")
+        log.bail("Invalid args (should only be called internally)")
 
 def main(argv):
     global conf, log
@@ -22,7 +22,7 @@
 
     parselocal(remain)
 
-    cmd = 'commit-email.pl "%(repos)s" "%(rev)s" %(project)s-commits@%(mailname)s' % conf
+    cmd = 'commit-email.pl --from svn-commits@%(mailname)s -r %(project)s-devel@%(mailname)s "%(repos)s" "%(rev)s" %(project)s-commits@%(mailname)s' % conf
     sourcebo.util.run_command(log, cmd)
 
 if __name__ == "__main__":

Added: trunk/sb_pre_commit_src
===================================================================
--- trunk/sb_pre_commit_src	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_pre_commit_src	2005-11-17 16:38:57 UTC (rev 82)
@@ -0,0 +1,42 @@
+#!/usr/bin/env python2.4
+
+import os
+import sys
+
+import sourcebo.config
+import sourcebo.util
+
+from sourcebo.errors import *
+
+
+def parselocal(remain):
+    try:
+        conf['repos'], conf['rev'] = remain[0:2]
+    except ValueError:
+        log.bail("Invalid args (should only be called internally)")
+
+def main(argv):
+    global conf, log
+
+    conf, remain, log = sourcebo.config.setup(argv)
+
+    parselocal(remain)
+
+    fname = os.path.join(conf['projectconfigpath'], 'commit-review')
+    conf['commit-paths'] = fname
+
+    if not os.access(fname, os.F_OK):
+        sys.exit(0)
+
+    fname = os.path.join(conf['projectconfigpath'], 'passwd')
+    conf['committers-file'] = fname
+
+    cmd = 'verify-commit.pl %(repos)s %(rev)s %(committers-file)s %(commit-paths)s' % conf
+
+    try:
+        sourcebo.util.run_command(log, cmd)
+    except SourceboError:
+        sys.exit(1)
+
+if __name__ == "__main__":
+    main(sys.argv)


Property changes on: trunk/sb_pre_commit_src
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/sb_project_index
===================================================================
--- trunk/sb_project_index	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_project_index	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 # Sourcebo - A collaborative development system
 #
@@ -38,30 +38,54 @@
 href="/projects/%(project)s/">%(projecttitle)s</a></td><td></td></tr>
 """
 
+desc_template = """<tr>
+<td bgcolor="white">
+<a href="/projects/%(project)s/">%(projecttitle)s</a>
+</td>
+<td bgcolor="white">
+%(projectdesc)s
+</td>
+</tr>
+"""
+
 def main(argv):
     global conf, log
 
     conf, remain, log = sourcebo.config.setup(argv, project=False)
 
-    projects = sourcebo.projects.get_project_descriptions(conf)
-
-    plist = ''
-    for p in projects:
-        plist += project_list_template % p
-
     t = sourcebo.template.Template(os.path.join(conf['templatepath'],
                                                 "projects.html"))
-    t.set("projects", plist)
 
-    outpath = os.path.join(conf['datapath'], "docroot", "index-bo.html")
+    t.set("projects", sourcebo.projects.get_project_list_html(conf))
 
+    descs = sourcebo.projects.get_project_descriptions(conf)
+
+    desc_table = """<table width="100%" bgcolor="gray" border=0 cellpadding=1 cellspacing=0><tr><td>
+<table width="100%" cellpadding=1 cellspacing=1 border=0>
+<tr>
+<td bgcolor="white">
+<b>Title</b>
+</td>
+<td bgcolor="white">
+<b>Description</b>
+</td>
+</tr>
+"""
+
+    for d in descs:
+        desc_table += desc_template % d
+
+    desc_table += '</table>\n</td></tr></table>\n'
+
+    t.set("descriptions", desc_table)
+
+    outpath = os.path.join(conf['indexpath'], "projects.html")
+
     try:
         t.output(outpath)
     except IOError, e:
         log.bail('Unable to write "%s": %s' % (outpath, e))
 
-    sys.exit(0)
-
 # Start
 if __name__ == "__main__":
     main(sys.argv)

Modified: trunk/sb_push_content
===================================================================
--- trunk/sb_push_content	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_push_content	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 # Sourcebo - A collaborative development system
 #

Modified: trunk/sb_queue_manager
===================================================================
--- trunk/sb_queue_manager	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_queue_manager	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 # Sourcebo - A collaborative development system
 #
@@ -285,7 +285,8 @@
 
         if self.lines[0] == 'ADD':
             try:
-                action = Action(*self.lines)
+                action = Action(self.lines[1], self.lines[2], self.lines[3],
+                                self.lines[4:])
             except TypeError:
                 log.err("Bad ADD data")
             else:
@@ -384,6 +385,8 @@
             loop.run()
             log.out("Exiting queue manager loop")
 
+            listener.cleanup()
+
         elif not add_to_ext_queue():
             log.bail("Could not add to queue!")
 

Modified: trunk/sb_regen_all
===================================================================
--- trunk/sb_regen_all	2005-11-12 03:18:29 UTC (rev 81)
+++ trunk/sb_regen_all	2005-11-17 16:38:57 UTC (rev 82)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.2
+#!/usr/bin/env python2.4
 
 # Sourcebo - A collaborative development system
 #



More information about the Sourcebo-commits mailing list