+ def clean_page(self, pagename):
+ filename = pagename_to_filename(pagename) + '.wiki'
+ cur_content = codecs.open(filename, 'r', 'utf-8').read()
+ if len(cur_content) != 0 and cur_content[-1] == '\n':
+ cur_content = cur_content[:-1]
+ fd = file(filename, 'w')
+ fd.write(cur_content.encode('utf-8'))
+ fd.close()
+