(self, tree_location)
| 326 | # Methods that change the working directory's content. |
| 327 | # |
| 328 | def set_tree(self, tree_location): |
| 329 | # It is not possible to remove the current directory. |
| 330 | d = os.getcwd() |
| 331 | os.chdir(os.path.dirname(self.workdir)) |
| 332 | shutil.rmtree(self.workdir, ignore_errors=False) |
| 333 | |
| 334 | if not os.path.isabs(tree_location): |
| 335 | tree_location = os.path.join(self.original_workdir, tree_location) |
| 336 | shutil.copytree(tree_location, self.workdir) |
| 337 | |
| 338 | os.chdir(d) |
| 339 | def make_writable(unused, dir, entries): |
| 340 | for e in entries: |
| 341 | name = os.path.join(dir, e) |
| 342 | os.chmod(name, os.stat(name).st_mode | 0o222) |
| 343 | for root, _, files in os.walk("."): |
| 344 | make_writable(None, root, files) |
| 345 | |
| 346 | def write(self, file, content, wait=True): |
| 347 | nfile = self.native_file_name(file) |
no outgoing calls