eggs/zc.buildout-1.5.2-py2.6.egg/zc/buildout/windows.txt
changeset 69 c6bca38c1cbf
equal deleted inserted replaced
68:5ff1fc726848 69:c6bca38c1cbf
       
     1 zc.buildout on MS-Windows
       
     2 =========================
       
     3 
       
     4 Certain aspects of every software project are dependent on the
       
     5 operating system used.
       
     6 The same - of course - applies to zc.buildout.
       
     7 
       
     8 To test that Windows doesn't get in the way, we'll test some system
       
     9 dependent aspects.
       
    10 The following recipe will create a read-only file which shutil.rmtree
       
    11 can'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 
       
    50 and 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