Changeset 186
- Timestamp:
- 02/28/07 15:52:34 (2 years ago)
- Files:
-
- trunk/cheesecake/cheesecake_index.py (modified) (3 diffs)
- trunk/cheesecake/util.py (modified) (2 diffs)
- trunk/tests/unit/_mockup_cheesecake.py (modified) (2 diffs)
- trunk/tests/unit/test_index_pylint.py (modified) (2 diffs)
- trunk/tests/unit/test_index_unit_tested.py (modified) (2 diffs)
- trunk/tests/unit/test_index_unittests.py (modified) (2 diffs)
- trunk/tests/unit/test_init_cleanup.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cheesecake/cheesecake_index.py
r185 r186 32 32 from util import StdoutRedirector 33 33 from util import time_function 34 from util import rmtree 34 35 from codeparser import CodeParser 35 36 from __init__ import __version__ as VERSION 36 import pep8 37 import pep8 37 38 38 39 __docformat__ = 'reStructuredText en' … … 1397 1398 if os.path.isdir(dirname): 1398 1399 self.log("Removing directory %s" % dirname) 1399 shutil.rmtree(dirname)1400 rmtree(dirname) 1400 1401 1401 1402 delete_dir(self.sandbox) … … 1626 1627 self.sandbox_pkg_dir = os.path.join(self.sandbox, self.package_name) 1627 1628 if os.path.isdir(self.sandbox_pkg_dir): 1628 shutil.rmtree(self.sandbox_pkg_dir)1629 rmtree(self.sandbox_pkg_dir) 1629 1630 1630 1631 # Call appropriate function to unpack the package. trunk/cheesecake/util.py
r184 r186 5 5 import shutil 6 6 import signal 7 import stat 7 8 import sys 8 9 import tarfile … … 231 232 end = time.time() 232 233 return ret, end-start 234 235 def rmtree(topdir): 236 """Remove the whole directory tree (including subdirectories). 237 238 Works around some Windows-specific behaviour of shutil.rmtree. 239 """ 240 all_privileges = stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC 241 242 # Make all files and diretories writable. 243 os.chmod(topdir, all_privileges) 244 for root, dirnames, filenames in os.walk(topdir): 245 for name in dirnames + filenames: 246 try: 247 os.chmod(os.path.join(root, name), all_privileges) 248 except OSError: 249 pass 250 251 shutil.rmtree(topdir, ignore_errors=True) 252 trunk/tests/unit/_mockup_cheesecake.py
r97 r186 7 7 from cheesecake.cheesecake_index import Cheesecake 8 8 from cheesecake.cheesecake_index import CheesecakeIndex 9 from cheesecake.util import rmtree 9 10 10 11 from _helper_cheesecake import create_empty_files_in_directory … … 46 47 47 48 def tearDown(self): 48 shutil.rmtree(self.temp_top_dir)49 rmtree(self.temp_top_dir) 49 50 os.unlink(self._mock_logfile) 50 51 trunk/tests/unit/test_index_pylint.py
r177 r186 6 6 from _helper_cheesecake import DATA_PATH, Glutton, create_empty_file 7 7 from cheesecake.cheesecake_index import IndexPyLint 8 from cheesecake.util import rmtree 8 9 from cheesecake import logger 9 10 … … 47 48 48 49 # Clean up. 49 shutil.rmtree(_package_dir)50 rmtree(_package_dir) trunk/tests/unit/test_index_unit_tested.py
r136 r186 9 9 from cheesecake.cheesecake_index import Cheesecake 10 10 from cheesecake.cheesecake_index import IndexUnitTested 11 from cheesecake.util import rmtree 11 12 from cheesecake import logger 12 13 … … 57 58 def tearDown(self): 58 59 if os.path.exists(self.sandbox_dir): 59 shutil.rmtree(self.sandbox_dir)60 rmtree(self.sandbox_dir) 60 61 61 62 def test_doctest(self): trunk/tests/unit/test_index_unittests.py
r155 r186 10 10 from cheesecake.cheesecake_index import IndexUnitTests 11 11 from cheesecake import logger 12 from cheesecake.util import rmtree 12 13 13 14 … … 35 36 def tearDown(self): 36 37 if os.path.exists(self.project_dir): 37 shutil.rmtree(self.project_dir)38 rmtree(self.project_dir) 38 39 39 40 def test_unit_tests_index(self): trunk/tests/unit/test_init_cleanup.py
r66 r186 6 6 from _helper_cheesecake import DATA_PATH 7 7 from cheesecake.cheesecake_index import Cheesecake 8 from cheesecake.util import rmtree 8 9 9 10 … … 12 13 if hasattr(self, 'cheesecake'): 13 14 if os.path.isdir(self.cheesecake.sandbox): 14 shutil.rmtree(self.cheesecake.sandbox)15 rmtree(self.cheesecake.sandbox) 15 16 if hasattr(self, 'logfile'): 16 17 if os.path.isfile(self.logfile):
