[Checkins] SVN: zc.buildout/trunk/zc.recipe.egg_/ Added some changes that were added in the wrong place.

Jim Fulton jim at zope.com
Wed Jan 17 16:45:03 EST 2007


Log message for revision 72074:
  Added some changes that were added in the wrong place.
  

Changed:
  U   zc.buildout/trunk/zc.recipe.egg_/CHANGES.txt
  U   zc.buildout/trunk/zc.recipe.egg_/src/zc/recipe/egg/README.txt
  U   zc.buildout/trunk/zc.recipe.egg_/src/zc/recipe/egg/egg.py

-=-
Modified: zc.buildout/trunk/zc.recipe.egg_/CHANGES.txt
===================================================================
--- zc.buildout/trunk/zc.recipe.egg_/CHANGES.txt	2007-01-17 20:13:12 UTC (rev 72073)
+++ zc.buildout/trunk/zc.recipe.egg_/CHANGES.txt	2007-01-17 21:45:02 UTC (rev 72074)
@@ -8,6 +8,18 @@
 Change History
 **************
 
+1.0.0b3 (2007-01-17)
+====================
+
+Feature Changes
+---------------
+
+- Added initialization and arguments options to the scripts recipe.
+
+- Added an eggs recipe that *just* installes eggs.
+
+- Advertized the scripts recipe for creating scripts.
+
 1.0.0b3 (2006-12-04)
 ====================
 

Modified: zc.buildout/trunk/zc.recipe.egg_/src/zc/recipe/egg/README.txt
===================================================================
--- zc.buildout/trunk/zc.recipe.egg_/src/zc/recipe/egg/README.txt	2007-01-17 20:13:12 UTC (rev 72073)
+++ zc.buildout/trunk/zc.recipe.egg_/src/zc/recipe/egg/README.txt	2007-01-17 21:45:02 UTC (rev 72074)
@@ -144,6 +144,14 @@
 extra-paths
    Extra paths to include in a generates script.
 
+initialization
+   Specify some Python initialization code.  This is very limited.  In
+   particular, be aware that leading whitespace is stripped from the
+   code given.
+
+arguments
+   Specify some arguments to be passed to entry points as Python source.
+
 Let's add an interpreter option:
 
     >>> write(sample_buildout, 'buildout.cfg',
@@ -327,6 +335,60 @@
     if __name__ == '__main__':
         eggrecipedemo.main()
 
+Specifying initialialization code and arguments
+-----------------------------------------------
+
+Sometimes, we ned to do more than just calling entry points.  We can
+use the initialialization and arguments options to specify extra code
+to be included in generated scripts:
+
+
+    >>> write(sample_buildout, 'buildout.cfg',
+    ... """
+    ... [buildout]
+    ... parts = demo
+    ...
+    ... [demo]
+    ... recipe = zc.recipe.egg
+    ... find-links = %(server)s
+    ... index = %(server)s/index
+    ... scripts = demo=foo
+    ... extra-paths =
+    ...    /foo/bar
+    ...    /spam/eggs
+    ... initialization = a = (1, 2
+    ...                       3, 4)
+    ... arguments = a, 2
+    ... """ % dict(server=link_server))
+
+    >>> print system(buildout),
+    buildout: Uninstalling demo
+    buildout: Installing demo
+
+    >>> cat(sample_buildout, 'bin', 'foo') # doctest: +NORMALIZE_WHITESPACE
+    #!/usr/local/bin/python2.4
+    <BLANKLINE>
+    import sys
+    sys.path[0:0] = [
+      '/tmp/tmpmypJLx/_TEST_/sample-buildout/eggs/demo-0.3-py2.4.egg',
+      '/tmp/tmpmypJLx/_TEST_/sample-buildout/eggs/demoneeded-1.1-py2.4.egg',
+      '/foo/bar',
+      '/spam/eggs',
+      ]
+    <BLANKLINE>
+    a = (1, 2
+    3, 4)
+    <BLANKLINE>
+    import eggrecipedemo
+    <BLANKLINE>
+    if __name__ == '__main__':
+        eggrecipedemo.main(a, 2)
+
+Here we see that the initialization code we specified was added after
+setting the path.  Note, as mentioennd above, that leading whitespace
+has been stripped.  Similarly, the argument code we specified was
+added in the entry point call (to main).
+
 Specifying entry points
 -----------------------
 

Modified: zc.buildout/trunk/zc.recipe.egg_/src/zc/recipe/egg/egg.py
===================================================================
--- zc.buildout/trunk/zc.recipe.egg_/src/zc/recipe/egg/egg.py	2007-01-17 20:13:12 UTC (rev 72073)
+++ zc.buildout/trunk/zc.recipe.egg_/src/zc/recipe/egg/egg.py	2007-01-17 21:45:02 UTC (rev 72074)
@@ -133,6 +133,8 @@
                 scripts=scripts,
                 extra_paths=self.extra_paths,
                 interpreter=options.get('interpreter'),
+                initialization=options.get('initialization', ''),
+                arguments=options.get('arguments', ''),
                 )
 
         return ()



More information about the Checkins mailing list