create articles dir if it doesn't exist

This commit is contained in:
Frédéric Péters 2006-08-16 12:06:53 +00:00
parent 4ee9f1b483
commit 13fd04b53f
1 changed files with 2 additions and 0 deletions

View File

@ -99,6 +99,8 @@ class ArticlesDirectory(Directory):
form.render()
else:
def submit():
if not os.path.exists(os.path.join(get_publisher().app_dir, 'articles')):
os.mkdir(os.path.join(get_publisher().app_dir, 'articles'))
text = form.get_widget('text').parse()
file(article_rst, 'w').write(text)
parts = docutils.examples.html_parts(text, input_encoding = 'iso-8859-1',