[Checkins] SVN: z3c.recipe.paster/trunk/ add PasteScript egg if it's not there to make sure it's installed
Adam Groszer
agroszer at gmail.com
Thu Jan 28 08:06:33 EST 2010
Log message for revision 108601:
add PasteScript egg if it's not there to make sure it's installed
Changed:
U z3c.recipe.paster/trunk/CHANGES.txt
U z3c.recipe.paster/trunk/src/z3c/recipe/paster/README.txt
U z3c.recipe.paster/trunk/src/z3c/recipe/paster/debug.txt
U z3c.recipe.paster/trunk/src/z3c/recipe/paster/paster.py
U z3c.recipe.paster/trunk/src/z3c/recipe/paster/serve.py
-=-
Modified: z3c.recipe.paster/trunk/CHANGES.txt
===================================================================
--- z3c.recipe.paster/trunk/CHANGES.txt 2010-01-28 12:12:59 UTC (rev 108600)
+++ z3c.recipe.paster/trunk/CHANGES.txt 2010-01-28 13:06:32 UTC (rev 108601)
@@ -5,6 +5,8 @@
0.5.2dev (unreleased)
---------------------
+- Fix: add PasteScript egg if it's not there to make sure it's installed
+
0.5.1 (2010-01-22)
------------------
Modified: z3c.recipe.paster/trunk/src/z3c/recipe/paster/README.txt
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/paster/README.txt 2010-01-28 12:12:59 UTC (rev 108600)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/paster/README.txt 2010-01-28 13:06:32 UTC (rev 108601)
@@ -115,7 +115,10 @@
<BLANKLINE>
import sys
sys.path[0:0] = [
- '...demo',
+ '/sample-buildout/demo',
+ '/sample-pyN.N.egg',
+ ...
+ '/sample-pyN.N.egg',
]
<BLANKLINE>
import os
@@ -129,6 +132,8 @@
'serve', '...myapp.ini',
]+sys.argv[1:])
+Those ``sample-pyN.N.egg`` lines should be PasteScript and it's dependencies.
+
Check the content of our new generated myapp.ini file:
>>> cat('parts', 'myapp', 'myapp.ini')
@@ -170,4 +175,3 @@
main = z3c.recipe.paster.wsgi:application_factory
""",
)
-
Modified: z3c.recipe.paster/trunk/src/z3c/recipe/paster/debug.txt
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/paster/debug.txt 2010-01-28 12:12:59 UTC (rev 108600)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/paster/debug.txt 2010-01-28 13:06:32 UTC (rev 108601)
@@ -114,6 +114,9 @@
import sys
sys.path[0:0] = [
'/sample-buildout/sample',
+ '/sample-pyN.N.egg',
+ ...
+ '/sample-pyN.N.egg',
]
<BLANKLINE>
import z3c.recipe.paster.debug
Modified: z3c.recipe.paster/trunk/src/z3c/recipe/paster/paster.py
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/paster/paster.py 2010-01-28 12:12:59 UTC (rev 108600)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/paster/paster.py 2010-01-28 13:06:32 UTC (rev 108601)
@@ -27,8 +27,10 @@
raise zc.buildout.UserError(
'You have to define at least one egg for setup a paster.')
- # add PasteScript egg
- options['eggs'] = '%s\nPasteScript' % options.get('eggs')
+ if 'PasteScript' not in options.get('eggs'):
+ # add PasteScript egg
+ options['eggs'] = '%s\nPasteScript' % options.get('eggs')
+
super(PasterSetup, self).__init__(buildout, name, options)
self.egg = zc.recipe.egg.Egg(buildout, name, options)
Modified: z3c.recipe.paster/trunk/src/z3c/recipe/paster/serve.py
===================================================================
--- z3c.recipe.paster/trunk/src/z3c/recipe/paster/serve.py 2010-01-28 12:12:59 UTC (rev 108600)
+++ z3c.recipe.paster/trunk/src/z3c/recipe/paster/serve.py 2010-01-28 13:06:32 UTC (rev 108601)
@@ -31,6 +31,15 @@
self.buildout = buildout
self.name = name
self.options = options
+
+ if options.get('eggs') is None:
+ raise zc.buildout.UserError(
+ 'You have to define at least one egg for setup an application.')
+
+ if 'PasteScript' not in options.get('eggs'):
+ # add PasteScript egg
+ options['eggs'] = '%s\nPasteScript' % options.get('eggs')
+
options['script'] = os.path.join(buildout['buildout']['bin-directory'],
options.get('script', self.name),
)
@@ -38,9 +47,6 @@
options['location'] = os.path.join(
buildout['buildout']['parts-directory'], name)
- if options.get('eggs') is None:
- raise zc.buildout.UserError(
- 'You have to define at least one egg for setup an application.')
self.egg = zc.recipe.egg.Egg(buildout, name, options)
def install(self):
More information about the checkins
mailing list