Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
01feff74
Commit
01feff74
authored
Jan 17, 2007
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some changes that were added in the wrong place.
parent
5137814e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
0 deletions
+76
-0
zc.recipe.egg_/CHANGES.txt
zc.recipe.egg_/CHANGES.txt
+12
-0
zc.recipe.egg_/src/zc/recipe/egg/README.txt
zc.recipe.egg_/src/zc/recipe/egg/README.txt
+62
-0
zc.recipe.egg_/src/zc/recipe/egg/egg.py
zc.recipe.egg_/src/zc/recipe/egg/egg.py
+2
-0
No files found.
zc.recipe.egg_/CHANGES.txt
View file @
01feff74
...
...
@@ -8,6 +8,18 @@ To do
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)
====================
...
...
zc.recipe.egg_/src/zc/recipe/egg/README.txt
View file @
01feff74
...
...
@@ -144,6 +144,14 @@ interpreter
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 @@ Let's look at the script that was generated:
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
-----------------------
...
...
zc.recipe.egg_/src/zc/recipe/egg/egg.py
View file @
01feff74
...
...
@@ -133,6 +133,8 @@ class Scripts(Eggs):
scripts
=
scripts
,
extra_paths
=
self
.
extra_paths
,
interpreter
=
options
.
get
(
'interpreter'
),
initialization
=
options
.
get
(
'initialization'
,
''
),
arguments
=
options
.
get
(
'arguments'
,
''
),
)
return
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment