Mercurial > hg > MakeItSo
comparison makeitso/makeitso.py @ 38:9739212a63c3
found a serious problem: directories stubbornly substitute into themselves
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Sat, 01 Jan 2011 22:34:29 -0800 |
| parents | 7cee2869bd7b |
| children | a2cdce0108e1 |
comparison
equal
deleted
inserted
replaced
| 37:7cee2869bd7b | 38:9739212a63c3 |
|---|---|
| 253 | 253 |
| 254 for dirname, dirnames, filenames in os.walk(self.name): | 254 for dirname, dirnames, filenames in os.walk(self.name): |
| 255 | 255 |
| 256 # interpolate directory names | 256 # interpolate directory names |
| 257 for d in dirnames: | 257 for d in dirnames: |
| 258 path = os.path.join(dirname, interpolated) | 258 path = os.path.join(dirname, d) |
| 259 interpolated = ContentTemplate(path).substitute(**variables) | 259 interpolated = ContentTemplate(path).substitute(**variables) |
| 260 if os.path.exists(interpolated): | 260 if os.path.exists(interpolated): |
| 261 # ensure its a directory | 261 # ensure its a directory |
| 262 pass | 262 pass |
| 263 else: | 263 else: |
| 264 os.makedirs(interpolated) | 264 os.makedirs(interpolated) |
