# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-__version__ = '$Id$'[4:-2]
+__version__ = '$Id$'[4:12]
-import cgi, sys, string, os, re, errno, time, stat
+from time import clock
+start_time = clock()
+
+import cgi, sys, string, os, re, errno, stat
from os import path, environ
# Regular expression defining a WikiWord
print_search_stats(len(hits), len(all_pages))
-
def do_titlesearch(needle):
# TODO: check needle is legal -- but probably we can just accept any RE
send_title(None, "Title search for \"" + needle + '"')
print_search_stats(len(hits), len(all_pages))
-
def print_search_stats(hits, searched):
print "<p>%d hits out of %d pages searched.</p>" % (hits, searched)
s = s + '</center></p>'
return s
-
def page_list():
return filter(word_re.match, os.listdir(text_dir))
-
def send_footer(name, mod_string=None):
if debug_cgi:
cgi.print_arguments()
cgi.print_environ()
global __version__
print '<div id="footer"><hr />'
- print ('<p class="copyright">Powered by' +
- ' <a href="http://www.codewiz.org/wiki/GeekiGeeki">GeekiGeeki</a>' +
- ' version %s</p>' % __version__)
+ print ('<p class="copyright"><span class="benchmark">generated in %0.3fs</span>' +
+ ' by <a href="http://www.codewiz.org/wiki/GeekiGeeki">GeekiGeeki</a>' +
+ ' version %s</p>') % (clock() - start_time, __version__)
if mod_string:
print '<p class="modified">last modified %s</p>' % mod_string
print '</div></body></html>'
-
# ----------------------------------------------------------
# Macros
def _macro_TitleSearch(*vargs):