[Checkins] SVN: cc.buildout_reports/ Initial import of developer reporting recipe for buildout.

Nathan Yergler nathan at yergler.net
Wed Aug 22 13:54:18 EDT 2007


Log message for revision 79138:
  Initial import of developer reporting recipe for buildout.
  

Changed:
  A   cc.buildout_reports/
  A   cc.buildout_reports/trunk/
  A   cc.buildout_reports/trunk/CHANGES.txt
  A   cc.buildout_reports/trunk/README.txt
  A   cc.buildout_reports/trunk/cc/
  A   cc.buildout_reports/trunk/cc/__init__.py
  A   cc.buildout_reports/trunk/cc/buildout_reports/
  A   cc.buildout_reports/trunk/cc/buildout_reports/XXXreport2html.py
  A   cc.buildout_reports/trunk/cc/buildout_reports/__init__.py
  A   cc.buildout_reports/trunk/cc/buildout_reports/xxx.py
  A   cc.buildout_reports/trunk/cc/buildout_reports/xxx_report.sh
  A   cc.buildout_reports/trunk/cc.buildout_reports.egg-info/
  A   cc.buildout_reports/trunk/cc.buildout_reports.egg-info/PKG-INFO
  A   cc.buildout_reports/trunk/cc.buildout_reports.egg-info/SOURCES.txt
  A   cc.buildout_reports/trunk/cc.buildout_reports.egg-info/dependency_links.txt
  A   cc.buildout_reports/trunk/cc.buildout_reports.egg-info/entry_points.txt
  A   cc.buildout_reports/trunk/cc.buildout_reports.egg-info/namespace_packages.txt
  A   cc.buildout_reports/trunk/cc.buildout_reports.egg-info/requires.txt
  A   cc.buildout_reports/trunk/cc.buildout_reports.egg-info/top_level.txt
  A   cc.buildout_reports/trunk/setup.py

-=-
Added: cc.buildout_reports/trunk/CHANGES.txt
===================================================================
--- cc.buildout_reports/trunk/CHANGES.txt	                        (rev 0)
+++ cc.buildout_reports/trunk/CHANGES.txt	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1 @@
+foo


Property changes on: cc.buildout_reports/trunk/CHANGES.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/README.txt
===================================================================
--- cc.buildout_reports/trunk/README.txt	                        (rev 0)
+++ cc.buildout_reports/trunk/README.txt	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,27 @@
+***********************
+Buildout GetText Recipe
+***********************
+
+.. contents::
+
+cc.gettext provides recipe[s] for manipulating gettext message catalogs.
+
+Compiling gettext catalogs
+==========================
+
+The cc.gettext:msgfmt recipe can be used to compile gettext catalogs from
+the .po source format to the binary .mo representation needed by Zope 3.
+It supports two options:
+
+po_path
+    A file path (relative to the buildout base or absolute) which is scanned
+    recursively for .po files.  All .po files found are processed by the 
+    recipe.
+
+mo_path
+    The base file path (relative to the buildout base or absolute) where
+    compiled .mo files are written.  Compiled files are named using the 
+    pattern <mo_path>/<locale>/LC_MESSAGES/<domain>.mo
+
+    If the specified path does not exist, the recipe will attempt to create
+    it.


Property changes on: cc.buildout_reports/trunk/README.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc/__init__.py
===================================================================
--- cc.buildout_reports/trunk/cc/__init__.py	                        (rev 0)
+++ cc.buildout_reports/trunk/cc/__init__.py	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)


Property changes on: cc.buildout_reports/trunk/cc/__init__.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc/buildout_reports/XXXreport2html.py
===================================================================
--- cc.buildout_reports/trunk/cc/buildout_reports/XXXreport2html.py	                        (rev 0)
+++ cc.buildout_reports/trunk/cc/buildout_reports/XXXreport2html.py	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,82 @@
+##############################################################################
+#
+# Copyright (c) 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Beautify a XXX report.
+
+Creates a HTML file from a XXXReport file.
+
+$Id$
+"""
+
+import sys
+import time
+
+
+if len(sys.argv) < 3:
+    print "Usage: beautifyXXX.py <input-filename> <output-filename>"
+    sys.exit()
+
+inputname = sys.argv[1]
+outputname = sys.argv[2]
+
+inputfile = open(inputname, "r")
+outputfile = open(outputname, "w")
+
+# Scan the inputfile. All lines that are "---" are used as delimiters
+
+comments = []
+# This is file, line, context
+current = ["", 0, []]
+for x in inputfile.readlines():
+    if x == "--\n":
+        print ".",
+        comments.append(current)
+        current = ["", 0, []]
+        currentfile = None
+        continue
+
+    if not current[0]:
+        splitted = x.split(":")
+        current[0] = splitted[0]
+        current[1] = splitted[1]
+        x = ":".join(splitted[2:])
+    else:
+        splitted = x.split("-")
+        x = "-".join(splitted[2:])
+    current[2].append(x)
+
+outputfile.write("""<html><head><title>XXX/YYY/ZZZTODO-Comment report</title>
+</head>
+
+<body>
+<h1>Developer report: XXX/YYY/ZZZ/TODO comments</h1>
+<p>Generated on %(reporttime)s</p>
+<hr>
+<h3>Summary</h3>
+<p>
+ There are currently %(commentcount)s XXX/YYY/ZZZ/TODO comments.
+</p>
+<hr/>
+<h3>Listing</h3>
+<ol>""" % {"commentcount" : len(comments),
+           "reporttime" : time.strftime("%a, %d %b %Y %H:%M:%S %Z", time.localtime())
+          })
+
+# Write the comments down
+
+for x in comments:
+    outputfile.write("""<li><b>File: %(filename)s:%(line)s</b><br/><pre>%(text)s</pre></li>""" % {'filename':x[0], 'line':x[1], 'text':"".join(x[2])})
+
+outputfile.write("<ol></body></html>")
+outputfile.flush()
+outputfile.close()


Property changes on: cc.buildout_reports/trunk/cc/buildout_reports/XXXreport2html.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc/buildout_reports/__init__.py
===================================================================
--- cc.buildout_reports/trunk/cc/buildout_reports/__init__.py	                        (rev 0)
+++ cc.buildout_reports/trunk/cc/buildout_reports/__init__.py	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,16 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""cc.buildout_reports package."""
+
+from xxx import XxxReport


Property changes on: cc.buildout_reports/trunk/cc/buildout_reports/__init__.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc/buildout_reports/xxx.py
===================================================================
--- cc.buildout_reports/trunk/cc/buildout_reports/xxx.py	                        (rev 0)
+++ cc.buildout_reports/trunk/cc/buildout_reports/xxx.py	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,80 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Generate a XXX/TODO report.
+"""
+
+import cc.buildout_reports
+
+import os
+import logging
+import subprocess
+import zc.buildout
+
+class XxxReport:
+    """Generate an HTML XXX/TODO comment report for the project.  Supports
+    the following configuration parameters:
+
+    * pattern: the pattern to scan for; if not specified, defaults to
+        (XXX|TODO)
+        
+    * report_file: the file to save the report to; if not specified, defaults
+        to XXXreport.html, stored in the buildout directory.  If specified
+        as a relative path, it is interpreted as relative to the buildout
+        directory.
+        
+    """
+    
+    def __init__(self, buildout, name, options):
+
+        self.buildout, self.name, self.options = buildout, name, options
+        
+        # perform sanity checking on parameters
+        
+        if 'pattern' not in options:
+            # no pattern to scan for provided; default to XXX|TODO
+            options['pattern'] = '?(XXX|TODO)'
+            
+            logging.getLogger(name).info(
+                "No comment pattern for XXX report specified; using %s",
+                options['pattern'])
+
+        if 'report_file' not in options:
+            # no output file provided; default to 'XXXreport.html'
+            options['report_file'] = os.path.join(
+                buildout['buildout']['directory'], 'XXXreport.html')
+            logging.getLogger(name).info(
+                "No output file for XXX report specified; using %s",
+                options['report_file'])
+        else:
+            # make sure the path is absolute
+            options['report_file'] = os.path.abspath(options['report_file'])
+
+
+    def install(self):
+        """Generate the XXX report for this project."""
+
+        paths = []
+        script_name = os.path.join(
+            os.path.dirname(cc.buildout_reports.__file__),
+            'xxx_report.sh')
+
+        subprocess.call([script_name,
+                         self.buildout['buildout']['directory'],
+                         self.options['report_file'],
+                         self.options['pattern']
+                         ])
+                
+        return [self.options['report_file']]
+
+    update = install


Property changes on: cc.buildout_reports/trunk/cc/buildout_reports/xxx.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc/buildout_reports/xxx_report.sh
===================================================================
--- cc.buildout_reports/trunk/cc/buildout_reports/xxx_report.sh	                        (rev 0)
+++ cc.buildout_reports/trunk/cc/buildout_reports/xxx_report.sh	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,33 @@
+#!/bin/bash
+##############################################################################
+#
+# Copyright (c) 2002-2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+# ./xxx_report.sh [base] [output_file] [pattern]
+
+PYTHON=`which python2.4`
+
+PATTERN=$3
+TMPFILE=`mktemp` 
+TARGET=$2
+FINDBASE=$1
+SW_BASE=`dirname $0`
+
+# find also finds hidden files
+rm $TARGET
+find $FINDBASE -wholename '*.svn' -prune -o -wholename '*.egg' -prune \
+    -o -! -name '*~' -! -name '*.pyc' -print0 | \
+    xargs -0 grep -niIs -A 3 -E "# $PATTERN" | \
+    $PYTHON $SW_BASE/XXXreport2html.py /dev/stdin $TARGET >/dev/null
+    
+rm -f $TMPFILE


Property changes on: cc.buildout_reports/trunk/cc/buildout_reports/xxx_report.sh
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/PKG-INFO
===================================================================
--- cc.buildout_reports/trunk/cc.buildout_reports.egg-info/PKG-INFO	                        (rev 0)
+++ cc.buildout_reports/trunk/cc.buildout_reports.egg-info/PKG-INFO	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,49 @@
+Metadata-Version: 1.0
+Name: cc.buildout-reports
+Version: 0.6
+Summary: Recipe for manipulating gettext message catalogs.
+Home-page: http://python.org/pypi/cc.gettext/
+Author: Nathan R. Yergler
+Author-email: nathan at creativecommons.org
+License: ZPL 2.1
+Description: ***********************
+        Buildout GetText Recipe
+        ***********************
+        
+        .. contents::
+        
+        cc.gettext provides recipe[s] for manipulating gettext message catalogs.
+        
+        Compiling gettext catalogs
+        ==========================
+        
+        The cc.gettext:msgfmt recipe can be used to compile gettext catalogs from
+        the .po source format to the binary .mo representation needed by Zope 3.
+        It supports two options:
+        
+        po_path
+        A file path (relative to the buildout base or absolute) which is scanned
+        recursively for .po files.  All .po files found are processed by the
+        recipe.
+        
+        mo_path
+        The base file path (relative to the buildout base or absolute) where
+        compiled .mo files are written.  Compiled files are named using the
+        pattern <mo_path>/<locale>/LC_MESSAGES/<domain>.mo
+        
+        If the specified path does not exist, the recipe will attempt to create
+        it.
+        
+        foo
+        
+        Download
+        **********************
+        
+Keywords: development build gettext
+Platform: UNKNOWN
+Classifier: Framework :: Buildout
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: Zope Public License
+Classifier: Topic :: Software Development :: Build Tools
+Classifier: Topic :: Software Development :: Libraries :: Python Modules


Property changes on: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/PKG-INFO
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/SOURCES.txt
===================================================================
--- cc.buildout_reports/trunk/cc.buildout_reports.egg-info/SOURCES.txt	                        (rev 0)
+++ cc.buildout_reports/trunk/cc.buildout_reports.egg-info/SOURCES.txt	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,13 @@
+README.txt
+setup.py
+cc/__init__.py
+cc.buildout_reports.egg-info/PKG-INFO
+cc.buildout_reports.egg-info/SOURCES.txt
+cc.buildout_reports.egg-info/dependency_links.txt
+cc.buildout_reports.egg-info/entry_points.txt
+cc.buildout_reports.egg-info/namespace_packages.txt
+cc.buildout_reports.egg-info/requires.txt
+cc.buildout_reports.egg-info/top_level.txt
+cc/buildout_reports/XXXreport2html.py
+cc/buildout_reports/__init__.py
+cc/buildout_reports/xxx.py


Property changes on: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/SOURCES.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/dependency_links.txt
===================================================================
--- cc.buildout_reports/trunk/cc.buildout_reports.egg-info/dependency_links.txt	                        (rev 0)
+++ cc.buildout_reports/trunk/cc.buildout_reports.egg-info/dependency_links.txt	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1 @@
+


Property changes on: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/dependency_links.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/entry_points.txt
===================================================================
--- cc.buildout_reports/trunk/cc.buildout_reports.egg-info/entry_points.txt	                        (rev 0)
+++ cc.buildout_reports/trunk/cc.buildout_reports.egg-info/entry_points.txt	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,3 @@
+[zc.buildout]
+xxx = cc.buildout_reports:XxxReport
+


Property changes on: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/entry_points.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/namespace_packages.txt
===================================================================
--- cc.buildout_reports/trunk/cc.buildout_reports.egg-info/namespace_packages.txt	                        (rev 0)
+++ cc.buildout_reports/trunk/cc.buildout_reports.egg-info/namespace_packages.txt	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1 @@
+cc


Property changes on: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/namespace_packages.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/requires.txt
===================================================================
--- cc.buildout_reports/trunk/cc.buildout_reports.egg-info/requires.txt	                        (rev 0)
+++ cc.buildout_reports/trunk/cc.buildout_reports.egg-info/requires.txt	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,2 @@
+setuptools
+zc.buildout
\ No newline at end of file


Property changes on: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/requires.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/top_level.txt
===================================================================
--- cc.buildout_reports/trunk/cc.buildout_reports.egg-info/top_level.txt	                        (rev 0)
+++ cc.buildout_reports/trunk/cc.buildout_reports.egg-info/top_level.txt	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1 @@
+cc


Property changes on: cc.buildout_reports/trunk/cc.buildout_reports.egg-info/top_level.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: cc.buildout_reports/trunk/setup.py
===================================================================
--- cc.buildout_reports/trunk/setup.py	                        (rev 0)
+++ cc.buildout_reports/trunk/setup.py	2007-08-22 17:54:18 UTC (rev 79138)
@@ -0,0 +1,62 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""zc.buildout recipes for generating developer reports
+"""
+
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup(
+    name = "cc.buildout_reports",
+    version = "0.1",
+    packages = find_packages('.'),
+    namespace_packages = ['cc',],
+    
+    # scripts and dependencies
+    install_requires = ['setuptools',
+                        'zc.buildout',
+                        ],
+
+    entry_points = {'zc.buildout':['xxx = cc.buildout_reports:XxxReport'],
+                    },
+    
+    # author metadata
+    author = 'Nathan R. Yergler',
+    author_email = 'nathan at creativecommons.org',
+    description = "Recipes for generating developer reports with zc.buildout.",
+    long_description = (
+        read('README.txt')
+        + '\n' +
+        read('CHANGES.txt')
+        + '\n' +
+        'Download\n'
+        '**********************\n'
+        ),
+    license = 'ZPL 2.1',
+    keywords = 'development build tools buildout',
+    url = 'http://python.org/pypi/cc.buildout_reports/',
+
+    classifiers = [
+       'Framework :: Buildout',
+       'Development Status :: 4 - Beta',
+       'Intended Audience :: Developers',
+       'License :: OSI Approved :: Zope Public License',
+       'Topic :: Software Development :: Build Tools',
+       'Topic :: Software Development :: Libraries :: Python Modules',
+       ],
+ 
+    )


Property changes on: cc.buildout_reports/trunk/setup.py
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Checkins mailing list