fhtaccess = open (htaccess_path, "w+")
fhtaccess.write (biaweb_strings.searchindex_htaccess)
fhtaccess.close ()
- except OSError, IOError:
+ except (OSError, IOError):
return False
# finally return true
try:
os.mkdir (os.path.join (conf[5], "cgi-bin"))
shutil.copy2 (search_script_path, os.path.join(conf[5], "cgi-bin"))
- except IOError, OSError:
+ except (IOError, OSError):
return False
# try to copy the star rating images to destination directory if possible
if os.path.exists (rating_img_star):
try:
shutil.copy2 (rating_img_star, conf[5])
- except IOError, OSError:
+ except (IOError, OSError):
return False
if os.path.exists (rating_img_greystar):
try:
shutil.copy2 (rating_img_greystar, conf[5])
- except IOError, OSError:
+ except (IOError, OSError):
return False
# additional files to copy
full_dest = os.path.join (conf[5], dest)
try:
shutil.copy2 (src, full_dest)
- except IOError, OSError:
+ except (IOError, OSError):
return False
# additional folders to copy
full_dest = os.path.join (conf[5], dest)
try:
shutil.copytree (src, full_dest)
- except IOError, OSError:
+ except (IOError, OSError):
return False
# finally return true
article_contents = art[4])
# now build the article page
- articlepage_str = tpl_main.safe_substitute (site_title = conf[1],
+ articlepage_str = tpl_main.safe_substitute (site_title = art[1],
site_url = "http://" + conf[0],
meta_keywords = art[3],
meta_description = art[2],
try:
farticle = open (os.path.join (conf[5], art[13], art[8] + ".html"), "w+")
farticle.write (articlepage_str)
- except OSError, IOError:
+ except (OSError, IOError):
return False
# finally return true
try:
# create the category directory
os.mkdir (os.path.join (conf[5], cat[3]))
- except IOError, OSError:
+ except (IOError, OSError):
return False
# now get the list of articles for the specified category
table_rows = tablerows_str)
# now create the index page
- categoryindex_str = tpl_main.safe_substitute (site_title = conf[1],
+ categoryindex_str = tpl_main.safe_substitute (site_title = conf[1] + " - " + cat[1],
site_url = "http://" + conf[0],
meta_keywords = conf[2],
meta_description = cat[2],
fcatindex = open (os.path.join (conf[5], cat[3], "index.html"), "w+")
fcatindex.write (categoryindex_str)
fcatindex.close ()
- except OSError, IOError:
+ except (OSError, IOError):
return False
# finally return true
try:
frss = open (os.path.join (conf[5], "subscribe.xml"), "w+")
frss.write (rss_str)
- except IOError, OSError:
+ except (IOError, OSError):
return False
# finally return true
findex = open (os.path.join (conf[5], "index.html"), "w+")
findex.write (main_str)
findex.close ()
- except IOError, OSError:
+ except (IOError, OSError):
return False
# write the style.css file in the destination directory
fstyle = open (os.path.join (conf[5], "style.css"), "w+")
fstyle.write (templates[5][1])
fstyle.close ()
- except IOError, OSError:
+ except (IOError, OSError):
return False
return True