#else
try:
input = open(name, "r")
- except IOError, error:
+ except IOError as error:
warn(#...... (scan_options) ...............
"can not open input file: "+name, error)
continue
# and finally print the html-formatted output
try:
F = open(o.libhtmlfile, "w")
-except IOError, error:
+except IOError as error:
warn(# ............. open(o.libhtmlfile, "w") ..............
"can not open html output file: "+o.libhtmlfile, error)
else:
try:
F = open(o.docbookfile,"w")
-except IOError, error:
+except IOError as error:
warn("can not open docbook output file: "+o.docbookfile, error)
else:
print >> F, doctype, '<reference><title>Manual Pages</title>'
# _____________________________________________________________________
try:
F = open( o.dumpdocfile, "w")
-except IOError, error:
+except IOError as error:
warn ("can not open"+o.dumpdocfile,error)
else:
for func in function_list:
comment = self.header.comment
try:
comment = self.header.get_otherlines()
- except Exception, e:
+ except Exception:
pass
mode = ""
text = ""
def get_title(self):
if self.title: return title
try: return self.text[0].get_title()
- except Exception, e: pass
+ except Exception: pass
return self.title
def _xml_doctype(self, rootnode):
return "<!DOCTYPE "+rootnode+self.docbook_dtd+">"
def _xml_text(self, xml):
""" accepts adapter objects with .xml_text() """
try: return xml.xml_text()
- except Exception, e: print "DocbookDocument/text", e; pass
+ except Exception as e: print "DocbookDocument/text", e; pass
return str(xml)
def _fetch_rootnode(self, text):
fetch = Match(r"^[^<>]*<(\w+)\b")
print >>fd, xml_text
fd.close()
return True
- except IOError, e:
+ except IOError as e:
print "could not open '"+filename+"'file", e
return False
def save_all(self, filename):
print >>fd, "</"+self.rootnode+">"
fd.close()
return True
- except IOError, e:
+ except IOError as e:
print "could not open '"+filename+"'file", e
return False
callspec = entry.head_get_callspec()
head_text = ("<code><b><function>"+namespec+"</function></b>"
+callspec+" : "+prespec+"</code>")
- except Exception, e:
+ except Exception:
pass
try:
extraline = ""
'<em><small>'+filename+'</small></em>'+
'</td></table>')
body_text = extraline + body_text
- except Exception, e:
+ except Exception:
pass
def link(text):
return (text & Match("<function>(\w*)</function>")
doc.filename = filename
doc.add(f.read())
f.close()
- except IOError, e:
+ except IOError:
print >> sys.stderr, "can not open "+filename
return doc.value()
def get_title(self):
if self.title: return self.title
try: return self.text[0].get_title()
- except Exception, e: pass
+ except Exception: pass
return self.title
def _html_meta(self, meta):
""" accepts adapter objects with .html_meta() """
try: return meta.html_meta()
- except Exception, e: pass
+ except Exception: pass
return str(meta)
def _html_style(self, style):
""" accepts adapter objects with .html_style() and .xml_style() """
ee = None
try: return style.html_style()
- except Exception, e: ee = e; pass
+ except Exception as e: ee = e; pass
try: return style.xml_style()
- except Exception, e: print "HtmlDocument/style", ee, e; pass
+ except Exception as e: print "HtmlDocument/style", ee, e; pass
try: return str(style)
- except Exception, e: print "HtmlDocument/style", e; return ""
+ except Exception as e: print "HtmlDocument/style", e; return ""
def _html_text(self, html):
""" accepts adapter objects with .html_text() and .xml_text() """
ee = None
try: return html.html_text()
- except Exception, e: ee = e; pass
+ except Exception as e: ee = e; pass
try: return html.xml_text()
- except Exception, e: print "HtmlDocument/text", ee, e; pass
+ except Exception as e: print "HtmlDocument/text", ee, e; pass
try: return str(html)
- except Exception, e: print "HtmlDocument/text", e; return " "
+ except Exception as e: print "HtmlDocument/text", e; return " "
def navigation(self):
if self.navi:
return self.navi
self.navi = fd.read()
fd.close()
return self.navi
- except Exception, e:
+ except Exception:
pass
return None
def html_header(self):
print >>fd, self.html_footer()
fd.close()
return True
- except IOError, e:
+ except IOError as e:
print "could not open '"+filename+"'file", e
return False
self.src_text = fd.read()
fd.close()
return True
- except IOError, e:
+ except IOError:
pass
return False
def assert_src_text(self):