Dvergar/dopresskit-static — pull request #1 by Rastagong (2014-06-26 18:55:51+00:00)
Title: Creates the images folder when it doesn't exist (the first time)

Hi there!

Thanks for writing this tool! presskit() was already quite practical, but a static presskit makes more sense and is even easier to set up! Also, kudos for choosing Python and Jinja. <3

An exception is raised in *get_images* (line 139) when listing the images. The problem is that *os.listdir* can't list anything if the images folder doesn't exist, which is the case in a fresh install.

Note that you won't notice it if you've already generated a website, you need to get a fresh install (or at least to delete the *images* folder). I suppose you had manually created this folder while writing the script, which prevented you to realise the problem.

The solution is to try to create the folder with *os.mkdir* before using *os.listdir*.

![error-os-listdir](https://cloud.githubusercontent.com/assets/720624/3402956/9ec9f92c-fd61-11e3-9f1e-a1e76f78f98c.png)