mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 04:24:27 +00:00
Fix #355 support python 2.4 sha hashing
This commit is contained in:
parent
b62dfde447
commit
65ccd2d7c1
@ -417,7 +417,11 @@ class Preferences(component.Component):
|
||||
|
||||
def set_config(self):
|
||||
"""Sets all altered config values in the core"""
|
||||
import hashlib
|
||||
try:
|
||||
from hashlib import sha1 as sha_hash
|
||||
except ImportError:
|
||||
from sha import new as sha_hash
|
||||
|
||||
# Get the values from the dialog
|
||||
new_core_config = {}
|
||||
new_gtkui_config = {}
|
||||
@ -520,7 +524,7 @@ class Preferences(component.Component):
|
||||
self.glade.get_widget("chk_start_in_tray").get_active()
|
||||
new_gtkui_config["lock_tray"] = \
|
||||
self.glade.get_widget("chk_lock_tray").get_active()
|
||||
passhex = hashlib.sha1(\
|
||||
passhex = sha_hash(\
|
||||
self.glade.get_widget("txt_tray_password").get_text()).hexdigest()
|
||||
if passhex != "c07eb5a8c0dc7bb81c217b67f11c3b7a5e95ffd7":
|
||||
new_gtkui_config["tray_password"] = passhex
|
||||
|
Loading…
x
Reference in New Issue
Block a user