#
# Copyright 1999, 2000 Martin Pool <mbp@humbug.org.au>
# Copyright 2002 Gerardo Poggiali
#
# Copyright 1999, 2000 Martin Pool <mbp@humbug.org.au>
# Copyright 2002 Gerardo Poggiali
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
links = map(lambda ch: '<a href="#%s">%s</a>' % (ch, ch), 'abcdefghijklmnopqrstuvwxyz')
return '<p><center>'+ ' | '.join(links) + '</center></p>'
links = map(lambda ch: '<a href="#%s">%s</a>' % (ch, ch), 'abcdefghijklmnopqrstuvwxyz')
return '<p><center>'+ ' | '.join(links) + '</center></p>'
-def page_list():
- return filter(word_re.match, os.listdir(data_dir))
+def page_list(dir = None, re = word_re):
+ return filter(re.match, os.listdir(dir or data_dir))
def send_footer(name, mod_string=None):
if globals().get('debug_cgi', False):
def send_footer(name, mod_string=None):
if globals().get('debug_cgi', False):
+ r"|(?P<word>\b(?:[A-Z][a-z]+){2,}\b)" # LEGACY
+ r"|(?P<url>(http|https|ftp|mailto)\:[^\s'\"]+\S)" # LEGACY
+ r"|(?P<email>[-\w._+]+\@[\w.-]+)" # LEGACY
+ r"|(?P<word>\b(?:[A-Z][a-z]+){2,}\b)" # LEGACY
+ r"|(?P<url>(http|https|ftp|mailto)\:[^\s'\"]+\S)" # LEGACY
+ r"|(?P<email>[-\w._+]+\@[\w.-]+)" # LEGACY
# look for the end of words and the start of a new word and insert a space there
return re.sub('([a-z])([A-Z])', r'\1 \2', self.page_name)
# look for the end of words and the start of a new word and insert a space there
return re.sub('([a-z])([A-Z])', r'\1 \2', self.page_name)
except IOError, er:
if er.errno == errno.ENOENT:
return '' # just doesn't exist, use default
if er.errno == errno.EISDIR:
except IOError, er:
if er.errno == errno.ENOENT:
return '' # just doesn't exist, use default
if er.errno == errno.EISDIR:
def _last_modified(self):
try:
from time import localtime, strftime
def _last_modified(self):
try:
from time import localtime, strftime
def _write_file(self, data):
tmp_filename = self._tmp_filename()
open(tmp_filename, 'wb').write(data)
def _write_file(self, data):
tmp_filename = self._tmp_filename()
open(tmp_filename, 'wb').write(data)