X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=geekigeeki.py;h=b34f152188b0544747471a796258d521f9eb0aba;hb=014d5c705784bfe7b47731ad5cc50568fc5e63cf;hp=a0345ee950f0c0fc750e874717dc9d5e34ddbad6;hpb=727c1cfdb0040ca5d95efb81c975d36d1f568c0b;p=geekigeeki.git
diff --git a/geekigeeki.py b/geekigeeki.py
index a0345ee..b34f152 100755
--- a/geekigeeki.py
+++ b/geekigeeki.py
@@ -1,8 +1,9 @@
-#! /usr/bin/env python
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
#
# Copyright 1999, 2000 Martin Pool ' + Page(page_name).link_to()
print ' . . . . ' + `count`
- print ['match', 'matches'][count <> 1]
+ print ['match', 'matches'][count != 1]
print ' %d hits out of %d pages searched.'
if msg_type == 'error':
print ' Software Failure. Press left mouse button to continue.\n'
- print msg
+ print msg_text
if msg_type == 'error':
print ' Guru Meditation #DEADBEEF.ABADC0DE'
print '
'
- # FIXME: This simple JS snippet is harder to pass than ACID 3.0
+ # FIXME: This little JS snippet is harder to pass than ACID 3.0
print """
"""
-def send_title(name, text="Limbo", msg=None, msg_type='error'):
+def send_title(name, text="Limbo", msg_text=None, msg_type='error'):
global title_done
if title_done: return
# Head
emit_header()
- print """
-
-"""
+ print ''
+ print ''
+
+ site_name = globals().get('site_name', 'Unconfigured Site')
print "
'
- elif self.in_var:
- self.in_var = False
- return '
'
- return ''
+ return '' + word + ''
def _tr_repl(self, word):
out = ''
@@ -441,16 +435,17 @@ class PageFormatter:
self.tr_cnt = 0
out = '' + out = out + ' | |
', ' | '][word.strip() == '||='] - def _tre_repl(self, word): + def _td_repl(self, word): if self.in_table: - return ' | ', ' | '][word.strip() == '||='] return '' - def _td_repl(self, word): + def _tre_repl(self, word): if self.in_table: - return ' | ' + return [' | ', ''][word.strip() == '||='] return '' def _indent_level(self): @@ -488,12 +483,13 @@ class PageFormatter: # For each line, we scan through looking for magic # strings, outputting verbatim any intervening text - # TODO: highlight search words (look at referer) + # TODO: highlight search words (look at referrer) scan_re = re.compile( r"(?:" # Formatting - + r"(?P
---|---|
\s*\|\|\s*)" + + r"|(?P | |
\s*\|\|(=|)\s*)"
+ r")")
pre_re = re.compile(
r"(?:"
+ r"(?P\s*\}\}\})" + + r"|(?P |