[gnome-commander] python plugins: replaced obsoleted md5 and sha libs with hashlib
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] python plugins: replaced obsoleted md5 and sha libs with hashlib
- Date: Tue, 2 Mar 2010 19:32:43 +0000 (UTC)
commit fc3c7a38c39c19decfcc832c589bedc4f782d905
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Tue Mar 2 20:28:25 2010 +0100
python plugins: replaced obsoleted md5 and sha libs with hashlib
configure.in | 2 +-
plugins/python/md5sum/md5sum.py | 4 ++--
plugins/python/sha1sum/sha1sum.py | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/configure.in b/configure.in
index 5bf0ced..e5574c7 100644
--- a/configure.in
+++ b/configure.in
@@ -47,7 +47,7 @@ GTK_REQ=2.8.0
GNOME_REQ=2.0.0
GNOMEUI_REQ=2.4.0
GNOMEVFS_REQ=2.0.0
-PYTHON_REQ=2.4
+PYTHON_REQ=2.5
EXIV2_REQ=0.14
TAGLIB_REQ=1.4
LIBGSF_REQ=1.12.0
diff --git a/plugins/python/md5sum/md5sum.py b/plugins/python/md5sum/md5sum.py
index 55f0679..210c8f8 100644
--- a/plugins/python/md5sum/md5sum.py
+++ b/plugins/python/md5sum/md5sum.py
@@ -27,7 +27,7 @@ except ImportError:
import os
import string
-import md5
+import hashlib
def main(main_wnd_xid, active_cwd, inactive_cwd, selected_files):
@@ -40,7 +40,7 @@ def main(main_wnd_xid, active_cwd, inactive_cwd, selected_files):
f = file(active_cwd+os.sep+uri.short_name, 'rb')
file_content = f.read()
f.close()
- md5sum = md5.new(file_content).hexdigest()
+ md5sum = hashlib.md5(file_content).hexdigest()
f_md5sum.write('%s %s\n' % (md5sum, uri.short_name))
f_md5sum.close()
return True
diff --git a/plugins/python/sha1sum/sha1sum.py b/plugins/python/sha1sum/sha1sum.py
index c689ee7..d6c25c9 100644
--- a/plugins/python/sha1sum/sha1sum.py
+++ b/plugins/python/sha1sum/sha1sum.py
@@ -27,7 +27,7 @@ except ImportError:
import os
import string
-import sha
+import hashlib
def main(main_wnd_xid, active_cwd, inactive_cwd, selected_files):
@@ -40,7 +40,7 @@ def main(main_wnd_xid, active_cwd, inactive_cwd, selected_files):
f = file(active_cwd+os.sep+uri.short_name, 'rb')
file_content = f.read()
f.close()
- sha1sum = sha.new(file_content).hexdigest()
+ sha1sum = hashlib.sha1(file_content).hexdigest()
f_sha1sum.write('%s %s\n' % (sha1sum, uri.short_name))
f_sha1sum.close()
return True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]