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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.buildout
Commits
536d5a13
Commit
536d5a13
authored
Aug 21, 2012
by
Marius Gedminas
Committed by
Domen Kožar
Aug 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge
parent
e65b7bfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
src/zc/buildout/buildout.txt
src/zc/buildout/buildout.txt
+9
-6
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+13
-1
No files found.
src/zc/buildout/buildout.txt
View file @
536d5a13
...
...
@@ -440,6 +440,10 @@ the mkdir recipe to support multiple paths:
... pass
... """)
..
>>> clean_up_pyc(sample_buildout, 'recipes', 'mkdir.py')
If there is an error creating a path, the install method will exit and
leave previously created paths in place:
...
...
@@ -549,6 +553,10 @@ Let's fix the recipe:
... pass
... """)
..
>>> clean_up_pyc(sample_buildout, 'recipes', 'mkdir.py')
And put back the typo:
>>> write(sample_buildout, 'buildout.cfg',
...
...
@@ -578,11 +586,6 @@ When we rerun the buildout:
...
OSError: [Errno 17] File exists: '/sample-buildout/bin'
.. Wait for the file to really disappear. My linux is weird.
>>> wait_until("foo goes away", lambda : not os.path.exists('foo'),
... timeout=200)
we get the same error, but we don't get the directory left behind:
>>> os.path.exists('foo')
...
...
@@ -636,7 +639,7 @@ recipe:
..
>>>
remove(sample_buildout, 'recipes', 'mkdir.pyc
')
>>>
clean_up_pyc(sample_buildout, 'recipes', 'mkdir.py
')
We returned by calling created, taking advantage of the fact that it
returns the registered paths. We did this for illustrative purposes.
...
...
src/zc/buildout/testing.py
View file @
536d5a13
...
...
@@ -99,6 +99,17 @@ def write(dir, *args):
fsync(f.fileno())
f.close()
def clean_up_pyc(*path):
base, filename = os.path.join(*path[:-1]), path[-1]
if filename.endswith('
.
py
'):
filename += '
c
' # .py -> .pyc
for path in (
os.path.join(base, filename),
os.path.join(base, '
__pycache__
', filename),
):
if os.path.exists(path):
remove(path)
## FIXME - check for other platforms
MUST_CLOSE_FDS = not sys.platform.startswith('
win
')
...
...
@@ -432,7 +443,8 @@ def buildoutSetUp(test):
start_server = start_server,
buildout = os.path.join(sample, 'bin', 'buildout'),
wait_until = wait_until,
make_py = make_py
make_py = make_py,
clean_up_pyc = clean_up_pyc,
))
def buildoutTearDown(test):
...
...
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