changeset 475:b31cef9e55f0

automatically create datadir if it doesn't exist
author sheep@ghostwheel
date Fri, 12 Sep 2008 19:08:44 +0200
parents f7ab7c5bba5b
children 534123ed9474
files dandelion/wiki.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dandelion/wiki.py	Fri Sep 12 19:03:15 2008 +0200
+++ b/dandelion/wiki.py	Fri Sep 12 19:08:44 2008 +0200
@@ -77,6 +77,8 @@
         self.config = cfg
 
         data_dir = self.config['setup', 'data_dir']
+        if not os.path.exists(data_dir):
+            os.makedirs(data_dir)
         lib_dir = os.path.dirname(os.path.abspath(__file__))
         index_file = os.path.join(data_dir, "search")
         pages_dir = os.path.join(data_dir, "pages")