From: Bernie Innocenti ' + Page(page_name).link_to())
- print(' . . . . ' + str(count))
- print ' ' + link_tag(page_name)
- print ' . . . . ' + `count`
- print ['match', 'matches'][count != 1]
- print ' ' + link_tag(page_name))
++ print(' . . . . ' + `count`)
+ print(['match', 'matches'][count != 1])
+ print(' ' + Page(filename).link_to() + " ' + link_tag(filename) + " ' + link_tag(filename) + " '+ ' | '.join(links) + ''
+ print('
'
- print '' \
- % relative_url('sys/GuruMeditation.js')
++ print('' \
++ % relative_url('sys/GuruMeditation.js'))
def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=False):
global title_done
@@@ -152,37 -142,37 +141,37 @@@
send_guru(msg_text, msg_type)
# Navbar
- print ' ')
def send_httperror(status="403 Not Found", query=""):
- print "Status: %s" % status
+ print("Status: %s" % status)
send_title(None, msg_text=("%s: on query '%s'" % (status, query)))
send_footer()
@@@ -218,13 -230,13 +229,13 @@@ def handle_fullsearch(needle)
hits.sort()
hits.reverse()
- print "')
if msg_type == 'error':
- print ' Software Failure. Press left mouse button to continue.\n'
- print msg_text
+ print(' Software Failure. Press left mouse button to continue.\n')
+ print(msg_text)
if msg_type == 'error':
- print('\n Guru Meditation #DEADBEEF.ABADC0DE')
- print('
')
- # FIXME: This little JS snippet is harder to pass than ACID 3.0
- print("""
- """)
+ print '\n Guru Meditation #DEADBEEF.ABADC0DE'
- print '"
+ print("
")
print_search_stats(len(hits), len(all_pages))
@@@ -234,12 -246,12 +245,12 @@@ def handle_titlesearch(needle)
needle_re = re.compile(needle, re.IGNORECASE)
all_pages = page_list()
- hits = filter(needle_re.search, all_pages)
+ hits = list(filter(needle_re.search, all_pages))
- print "")
for (count, page_name) in hits:
- print('
"
++ print('"
+ print("
")
print_search_stats(len(hits), len(all_pages))
@@@ -275,9 -287,10 +286,10 @@@ def handle_edit(pagename)
text = form['savetext'].value
pg.send_editor(text)
+ # Used by macros/WordIndex and macros/TitleIndex
def make_index_key():
- links = map(lambda ch: '%s' % (ch, ch), 'abcdefghijklmnopqrstuvwxyz')
- return '")
for filename in hits:
- print('
"
++ print('
' + ' | '.join(links) + '
' def page_list(dirname = None, re = word_re): return sorted(filter(re.match, os.listdir(dirname or data_dir))) @@@ -287,16 -300,16 +299,16 @@@ def send_footer(mod_string=None) cgi.print_arguments() cgi.print_form(form) cgi.print_environ() - print ''' + print('''