projects
/
biaweb_qt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed except statements subtle syntax error
[biaweb_qt.git]
/
biaweb_exporter.py
diff --git
a/biaweb_exporter.py
b/biaweb_exporter.py
index
b940867
..
2f1a306
100644
(file)
--- a/
biaweb_exporter.py
+++ b/
biaweb_exporter.py
@@
-132,7
+132,7
@@
def generate_search_index (dbname, conf, full_text_index = True):
fhtaccess = open (htaccess_path, "w+")
fhtaccess.write (biaweb_strings.searchindex_htaccess)
fhtaccess.close ()
fhtaccess = open (htaccess_path, "w+")
fhtaccess.write (biaweb_strings.searchindex_htaccess)
fhtaccess.close ()
- except
OSError, IOError
:
+ except
(OSError, IOError)
:
return False
# finally return true
return False
# finally return true
@@
-147,7
+147,7
@@
def copy_files_folders (conf, files_to_copy, folders_to_copy):
try:
os.mkdir (os.path.join (conf[5], "cgi-bin"))
shutil.copy2 (search_script_path, os.path.join(conf[5], "cgi-bin"))
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
return False
# try to copy the star rating images to destination directory if possible
@@
-157,12
+157,12
@@
def copy_files_folders (conf, files_to_copy, folders_to_copy):
if os.path.exists (rating_img_star):
try:
shutil.copy2 (rating_img_star, conf[5])
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])
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
return False
# additional files to copy
@@
-175,7
+175,7
@@
def copy_files_folders (conf, files_to_copy, folders_to_copy):
full_dest = os.path.join (conf[5], dest)
try:
shutil.copy2 (src, full_dest)
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
return False
# additional folders to copy
@@
-187,7
+187,7
@@
def copy_files_folders (conf, files_to_copy, folders_to_copy):
full_dest = os.path.join (conf[5], dest)
try:
shutil.copytree (src, full_dest)
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
return False
# finally return true
@@
-233,7
+233,7
@@
def generate_article_pages (dbname, conf, templates, category_str, bestrated_str
try:
farticle = open (os.path.join (conf[5], art[13], art[8] + ".html"), "w+")
farticle.write (articlepage_str)
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
return False
# finally return true
@@
-253,7
+253,7
@@
def generate_category_indices (dbname, conf, templates, category_str, bestrated_
try:
# create the category directory
os.mkdir (os.path.join (conf[5], cat[3]))
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
return False
# now get the list of articles for the specified category
@@
-298,7
+298,7
@@
def generate_category_indices (dbname, conf, templates, category_str, bestrated_
fcatindex = open (os.path.join (conf[5], cat[3], "index.html"), "w+")
fcatindex.write (categoryindex_str)
fcatindex.close ()
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
return False
# finally return true
@@
-339,7
+339,7
@@
def generate_rss_feed (dbname, conf):
try:
frss = open (os.path.join (conf[5], "subscribe.xml"), "w+")
frss.write (rss_str)
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
return False
# finally return true
@@
-399,7
+399,7
@@
def generate_home_page (dbname, conf, templates, category_str, bestrated_str):
findex = open (os.path.join (conf[5], "index.html"), "w+")
findex.write (main_str)
findex.close ()
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
return False
# write the style.css file in the destination directory
@@
-407,7
+407,7
@@
def generate_home_page (dbname, conf, templates, category_str, bestrated_str):
fstyle = open (os.path.join (conf[5], "style.css"), "w+")
fstyle.write (templates[5][1])
fstyle.close ()
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
return False
return True