From 0add52506b7c3e5d983a9d56cb5e57de689837ce Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 18 Jul 2008 02:15:01 +0000 Subject: [PATCH] Fix #355 add python 2.4 support in systemtray too --- deluge/ui/gtkui/systemtray.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py index 5db5689af..b8c4c094f 100644 --- a/deluge/ui/gtkui/systemtray.py +++ b/deluge/ui/gtkui/systemtray.py @@ -336,7 +336,11 @@ class SystemTray(component.Component): self.build_tray_bwsetsubmenu() def unlock_tray(self, is_showing_dlg=[False]): - import hashlib + try: + from hashlib import sha1 as sha_hash + except ImportError: + from sha import new as sha_hash + log.debug("Show tray lock dialog") result = False @@ -363,7 +367,7 @@ window, please enter your password")) tray_lock.vbox.pack_start(entered_pass) tray_lock.show_all() if tray_lock.run() == gtk.RESPONSE_ACCEPT: - if self.config["tray_password"] == hashlib.sha1(\ + if self.config["tray_password"] == sha_hash(\ entered_pass.get_text()).hexdigest(): result = True tray_lock.destroy()