comparison MoinMoin/action/info.py @ 6103:500f68d3e2fd

remove our own usage of python_compatibility module
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 06 Sep 2016 01:00:25 +0200
parents 48c7d851938f
children
comparison
equal deleted inserted replaced
6102:df21062e294d 6103:500f68d3e2fd
6 6
7 @copyright: 2000-2004 Juergen Hermann <jh@web.de>, 7 @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
8 2006-2008 MoinMoin:ThomasWaldmann 8 2006-2008 MoinMoin:ThomasWaldmann
9 @license: GNU GPL, see COPYING for details. 9 @license: GNU GPL, see COPYING for details.
10 """ 10 """
11 import hashlib
11 12
12 from MoinMoin import config, wikiutil, action 13 from MoinMoin import config, wikiutil, action
13 from MoinMoin.Page import Page 14 from MoinMoin.Page import Page
14 from MoinMoin.logfile import editlog 15 from MoinMoin.logfile import editlog
15 from MoinMoin.widget import html 16 from MoinMoin.widget import html
31 32
32 request.write(f.paragraph(1), 33 request.write(f.paragraph(1),
33 f.text(_("Page size: %d") % page.size()), 34 f.text(_("Page size: %d") % page.size()),
34 f.paragraph(0)) 35 f.paragraph(0))
35 36
36 from MoinMoin.support.python_compatibility import hash_new 37 digest = hashlib.new('sha1', page.get_raw_body().encode(config.charset)).hexdigest().upper()
37 digest = hash_new('sha1', page.get_raw_body().encode(config.charset)).hexdigest().upper()
38 request.write(f.paragraph(1), 38 request.write(f.paragraph(1),
39 f.rawHTML('%(label)s <tt>%(value)s</tt>' % { 39 f.rawHTML('%(label)s <tt>%(value)s</tt>' % {
40 'label': _("SHA digest of this page's content is:"), 40 'label': _("SHA digest of this page's content is:"),
41 'value': digest, }), 41 'value': digest, }),
42 f.paragraph(0)) 42 f.paragraph(0))