By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,573 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,573 IT Pros & Developers. It's quick & easy.

Re: Where does the command "ls" in some doctest files come from ?

P: n/a


KLEIN Stéphane wrote:
Hi,

for example, in http://svn.zope.org/zc.buildout/trunk/src/zc/buildout/
tests.py?rev=89831&view=auto test file, there is this doctests :

def develop_verbose():
"""
We should be able to deal with setup scripts that aren't setuptools based.
>>mkdir('foo')
>>write('foo', 'setup.py',
... '''
... from setuptools import setup
... setup(name="foo")
... ''')
>>write('buildout.cfg',
... '''
... [buildout]
... develop = foo
... parts =
... ''')
>>print system(join('bin', 'buildout')+' -vv'), # doctest: +ELLIPSIS
Installing...
Develop: '/sample-buildout/foo'
...
Installed /sample-buildout/foo
...
>>ls('develop-eggs')
- foo.egg-link
- zc.recipe.egg.egg-link
>>print system(join('bin', 'buildout')+' -vvv'), # doctest:
+ELLIPSIS
Installing...
Develop: '/sample-buildout/foo'
in: '/sample-buildout/foo'
... -q develop -mxN -d /sample-buildout/develop-eggs/...
"""

I wonder where does the "ls('develop-eggs')" command come from ?
'ls' is the unix abbreviation for the shell command 'list files (in a
directory)'. The name is used above for a similar Python function. It
presumably was imported somewhere before develop_verbose, or else is
part of the auto-imported site.py for a development site.

Sep 8 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.