links = ['<a href="#%s">%s</a>' % (ch, ch) for ch in 'abcdefghijklmnopqrstuvwxyz']
return '<p style="text-align: center">' + ' | '.join(links) + '</p>'
-def page_list(dirname = None, re = None):
+def page_list(dirname=None, re=None):
if re is None:
# FIXME: WikiWord is too restrictive now!
re = re.compile(r"^\b((([A-Z][a-z0-9]+){2,}/)*([A-Z][a-z0-9]+){2,})\b$")
try:
os.stat(self._filename())
return True
- except OSError as err:
+ except OSError, err:
if err.errno == errno.ENOENT:
return False
raise err
def get_raw_body(self, default=None):
try:
return open(self._filename(), 'rb').read()
- except IOError as err:
+ except IOError, err:
if err.errno == errno.ENOENT:
if default is None:
default = '//[[%s|Describe %s|action=edit]]//' % (self.page_name, self.page_name)
break
self._pragmas[m.group(1)] = m.group(2).strip()
#print "bernie: pragmas[" + m.group(1) + "] = " + m.group(2) + "<br>\n"
- except IOError as err:
+ except IOError, err:
if err.errno != errno.ENOENT and err.errno != errno.EISDIR:
raise er
return self._pragmas
try:
from time import localtime, strftime
modtime = localtime(os.stat(self._filename())[stat.ST_MTIME])
- except OSError as err:
+ except OSError, err:
if err.errno != errno.ENOENT:
raise err
return None
# Bad Bill! POSIX rename ought to replace. :-(
try:
os.remove(name)
- except OSError as err:
+ except OSError, err:
if err.errno != errno.ENOENT: raise err
os.rename(tmp_filename, name)