source: TI12-security/trunk/NDGSecurity/python/buildout/ndgsecurity/eggs/zc.buildout-1.2.1-py2.5.egg/zc/buildout/windows.txt @ 7081

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg-security/TI12-security/trunk/NDGSecurity/python/buildout/ndgsecurity/eggs/zc.buildout-1.2.1-py2.5.egg/zc/buildout/windows.txt@7081
Revision 7081, 1.9 KB checked in by pjkersha, 11 years ago (diff)
  • Property svn:keywords set to Id
Line 
1zc.buildout on MS-Windows
2=========================
3
4Certain aspects of every software project are dependent on the
5operating system used.
6The same - of course - applies to zc.buildout.
7
8To test that Windows doesn't get in the way, we'll test some system
9dependent aspects.
10The following recipe will create a read-only file which shutil.rmtree
11can't delete.
12
13    >>> mkdir('recipe')
14    >>> write('recipe', 'recipe.py',
15    ... '''
16    ... import os
17    ... class Recipe:
18    ...     def __init__(self, buildout, name, options):
19    ...         self.location = os.path.join(
20    ...              buildout['buildout']['parts-directory'],
21    ...              name)
22    ...
23    ...     def install(self):
24    ...         print "can't remove read only files"
25    ...         if not os.path.exists (self.location):
26    ...             os.makedirs (self.location)
27    ...
28    ...         name = os.path.join (self.location, 'readonly.txt')
29    ...         open (name, 'w').write ('this is a read only file')
30    ...         os.chmod (name, 0400)
31    ...         return ()
32    ...
33    ...     update = install
34    ... ''')
35
36    >>> write('recipe', 'setup.py',
37    ... '''
38    ... from setuptools import setup
39    ... setup(name='spam', version='1', py_modules=['recipe'],
40    ...       entry_points={'zc.buildout': ['default = recipe:Recipe']},
41    ...       )
42    ... ''')
43
44    >>> write('recipe', 'README', '')
45
46    >>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS
47    Running setup script 'recipe/setup.py'.
48    ...
49
50and we'll configure a buildout to use it:
51
52    >>> write('buildout.cfg',
53    ... '''
54    ... [buildout]
55    ... parts = foo
56    ... find-links = %s
57    ...
58    ... [foo]
59    ... recipe = spam
60    ... ''' % join('recipe', 'dist'))
61
62    >>> print system(buildout),
63    Getting distribution for 'spam'.
64    Got spam 1.
65    Installing foo.
66    can't remove read only files
Note: See TracBrowser for help on using the repository browser.