print("<ul>")
for (count, page_name) in hits:
print('<li><p>' + Page(page_name).link_to())
- print(' . . . . ' + repr(count))
+ print(' . . . . ' + str(count))
print(['match', 'matches'][count != 1])
print('</p></li>')
print("</ul>")
indent_re = re.compile(r"^\s*")
tr_re = re.compile(r"^\s*\|\|")
eol_re = re.compile(r"\r?\n")
- for self.line in eol_re.split(str(self.raw.expandtabs())):
+ for self.line in eol_re.split(str(self.raw.expandtabs(), 'utf-8')):
# Skip pragmas
if self.in_header:
if self.line.startswith('#'):
return os.path.join(data_dir, self.page_name)
def _tmp_filename(self):
- return os.path.join(data_dir, ('#' + self.page_name.replace('/','_') + '.' + repr(os.getpid()) + '#'))
+ return os.path.join(data_dir, ('#' + self.page_name.replace('/','_') + '.' + str(os.getpid()) + '#'))
def exists(self):
try:
def pragmas(self):
if not '_pragmas' in self.__dict__:
+ self._pragmas = {}
try:
file = open(self._filename(), 'rt')
attr_re = re.compile(r"^#(\S*)(.*)$")