A more generic way to do this would be to have an ignoreList of some kind so you can do something like

```
dirnames = [dn for dn in dirnames if dn in ignoreList]
```