Make sure that the file is writeable. Useful if our source is read-only.
(self, filename)
| 394 | os.chmod(new_path, current_mode & ~current_umask) |
| 395 | |
| 396 | def make_writeable(self, filename): |
| 397 | """ |
| 398 | Make sure that the file is writeable. |
| 399 | Useful if our source is read-only. |
| 400 | """ |
| 401 | if not os.access(filename, os.W_OK): |
| 402 | st = os.stat(filename) |
| 403 | new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR |
| 404 | os.chmod(filename, new_permissions) |