[Checkins] SVN: z3c.recipe.tag/trunk/ Add support for using this recipe with paver by providing a paver task.

Paul Carduner paulcarduner at gmail.com
Sun Aug 16 18:34:39 EDT 2009


Log message for revision 102864:
  Add support for using this recipe with paver by providing a paver task.

Changed:
  U   z3c.recipe.tag/trunk/README.txt
  U   z3c.recipe.tag/trunk/buildout.cfg
  _U  z3c.recipe.tag/trunk/src/
  U   z3c.recipe.tag/trunk/src/z3c/recipe/tag/__init__.py

-=-
Modified: z3c.recipe.tag/trunk/README.txt
===================================================================
--- z3c.recipe.tag/trunk/README.txt	2009-08-16 21:09:41 UTC (rev 102863)
+++ z3c.recipe.tag/trunk/README.txt	2009-08-16 22:34:39 UTC (rev 102864)
@@ -1,6 +1,9 @@
+==============
 z3c.recipe.tag
 ==============
 
+.. contents::
+
 Introduction
 ------------
 
@@ -25,6 +28,9 @@
 How to use this recipe
 ----------------------
 
+With Buildout
+.............
+
 Suppose you have an egg called ``MyApplication``.  To use this recipe with
 buildout, you would add the following to the ``buildout.cfg`` file::
 
@@ -38,7 +44,7 @@
   $ ./bin/tags
 
 By default, this script produces three files in the directory from
-which you ran the script: 
+which you ran the script:
 
 - a ctags file called ``TAGS`` for use by emacs,
 - a ctags file called ``tags`` for use by vi, and
@@ -50,7 +56,7 @@
 of ``./bin/tags --help``::
 
     usage: build_tags [options]
-    
+
     options:
       -h, --help            show this help message and exit
       -l LANGUAGES, --languages=LANGUAGES
@@ -61,6 +67,20 @@
       -b, --ctags-bbedit    flag to build bbedit ctags ``tags`` file
       -i, --idutils         flag to build idutils ``ID`` file
 
+With Paver
+..........
+
+If you are using `Paver
+<http://www.blueskyonmars.com/projects/paver/>`_ and already have
+z3c.recipe.tag installed, then all you have to do is add this line to
+your ``pavement.py`` file::
+
+  import z3c.recipe.tag
+
+And then run the ``z3c.recipe.tag.tags`` task from the command line::
+
+  $ paver z3c.recipe.tag.tags
+
 (BBEdit_ is a Macintosh text editor.)
 
 .. _BBEdit: http://barebones.com/products/bbedit/

Modified: z3c.recipe.tag/trunk/buildout.cfg
===================================================================
--- z3c.recipe.tag/trunk/buildout.cfg	2009-08-16 21:09:41 UTC (rev 102863)
+++ z3c.recipe.tag/trunk/buildout.cfg	2009-08-16 22:34:39 UTC (rev 102864)
@@ -1,7 +1,7 @@
 [buildout]
 index = http://download.zope.org/zope3.4
 develop = .
-parts = z3c.recipe.tag test
+parts = z3c.recipe.tag test tags
 newest = false
 
 [z3c.recipe.tag]
@@ -13,3 +13,7 @@
 recipe = zc.recipe.testrunner
 eggs = z3c.recipe.tag
 defaults = ['--exit-with-status', '--tests-pattern', '^f?tests$', '-v']
+
+[tags]
+recipe = z3c.recipe.tag:tags
+eggs = z3c.recipe.tag
\ No newline at end of file


Property changes on: z3c.recipe.tag/trunk/src
___________________________________________________________________
Added: svn:ignore
   + z3c.recipe.tag.egg-info


Modified: z3c.recipe.tag/trunk/src/z3c/recipe/tag/__init__.py
===================================================================
--- z3c.recipe.tag/trunk/src/z3c/recipe/tag/__init__.py	2009-08-16 21:09:41 UTC (rev 102863)
+++ z3c.recipe.tag/trunk/src/z3c/recipe/tag/__init__.py	2009-08-16 22:34:39 UTC (rev 102864)
@@ -115,7 +115,7 @@
 
     def _build_idutils(self):
         return [['mkid'],
-                ['-m', 
+                ['-m',
                  pkg_resources.resource_filename(
                     "z3c.recipe.tag", "id-lang.map"),
                  '-o',
@@ -152,7 +152,7 @@
         parser.values.targets = []
     parser.values.targets.append(const)
 
-def build_tags():
+def build_tags(args=None):
     parser = optparse.OptionParser()
     parser.add_option('-l', '--languages', dest='languages',
                       default='-JavaScript',
@@ -170,7 +170,7 @@
     parser.add_option('-i', '--idutils', action='callback',
                       callback=append_const, callback_args=('idutils',),
                       help='flag to build idutils ``ID`` file')
-    options, args = parser.parse_args()
+    options, args = parser.parse_args(args)
     if args:
         parser.error('no arguments accepted')
     targets = getattr(options, 'targets', None)
@@ -178,3 +178,17 @@
         parser.error('cannot build both vi and bbedit ctags files (same name)')
     builder = Builder()
     builder(targets, options.languages)
+
+try:
+    import paver.easy
+except ImportError:
+    HAS_PAVER = False
+else:
+    HAS_PAVER = True
+
+if HAS_PAVER:
+    @paver.easy.task
+    @paver.easy.consume_args
+    def tags(args):
+        """Build tags database file for emacs, vim, or bbedit"""
+        build_tags(args)



More information about the Checkins mailing list