avoid cli crash if css file is passed that does not exist

svn: r12807
This commit is contained in:
Benny Malengier 2009-07-16 12:48:31 +00:00
parent 19ea036795
commit 31f923bab6

View File

@ -284,8 +284,10 @@ class HtmlDoc(BaseDoc, TextDoc):
tdfile.close() tdfile.close()
#css file #css file
if self.css_filename: if self.css_filename:
self.copy_file(os.path.join(const.DATA_DIR, self.css_filename), #we do an extra check in case file does not exist, eg cli call
_HTMLSCREEN) fullpath = os.path.join(const.DATA_DIR, self.css_filename)
if os.path.exists(fullpath):
self.copy_file(fullpath, _HTMLSCREEN)
#favicon #favicon
self.copy_file(os.path.join(const.IMAGE_DIR, 'favicon.ico'), self.copy_file(os.path.join(const.IMAGE_DIR, 'favicon.ico'),
'favicon.ico') 'favicon.ico')