Commit 8d620cae authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

fixup! Add support for Python 3

This is another fixup for commit
1c8269b2.
parent d634f700
......@@ -3,7 +3,7 @@
# pylint: disable-msg=W0311,C0301,C0103,C0111
import datetime
import md5
import hashlib
import os
import re
import shutil
......@@ -13,6 +13,7 @@ import fnmatch
import werkzeug
from slapos.runner.utils import realpath, tail, isText
from slapos.util import str2bytes
class FileBrowser(object):
......@@ -59,7 +60,7 @@ class FileBrowser(object):
realfile = os.path.join(realdir, f)
mdate = datetime.datetime.fromtimestamp(os.path.getmtime(realfile)
).strftime("%Y-%d-%m %I:%M")
md5sum = md5.md5(realfile).hexdigest()
md5sum = hashlib.md5(str2bytes(realfile)).hexdigest()
if not os.path.isdir(realfile):
size = os.path.getsize(realfile)
regex = re.compile("(^.*)\.(.*)", re.VERBOSE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment