From 31f923bab63678b0a0ea07b217acafa28a06ea37 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 16 Jul 2009 12:48:31 +0000 Subject: [PATCH] avoid cli crash if css file is passed that does not exist svn: r12807 --- src/plugins/docgen/HtmlDoc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/docgen/HtmlDoc.py b/src/plugins/docgen/HtmlDoc.py index dc391f6ae..926205a55 100644 --- a/src/plugins/docgen/HtmlDoc.py +++ b/src/plugins/docgen/HtmlDoc.py @@ -284,8 +284,10 @@ class HtmlDoc(BaseDoc, TextDoc): tdfile.close() #css file if self.css_filename: - self.copy_file(os.path.join(const.DATA_DIR, self.css_filename), - _HTMLSCREEN) + #we do an extra check in case file does not exist, eg cli call + fullpath = os.path.join(const.DATA_DIR, self.css_filename) + if os.path.exists(fullpath): + self.copy_file(fullpath, _HTMLSCREEN) #favicon self.copy_file(os.path.join(const.IMAGE_DIR, 'favicon.ico'), 'favicon.ico')