mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 08:58:38 +00:00
Fix #355 support python 2.4 sha hashing
This commit is contained in:
parent
b62dfde447
commit
65ccd2d7c1
1 changed files with 6 additions and 2 deletions
|
@ -417,7 +417,11 @@ class Preferences(component.Component):
|
||||||
|
|
||||||
def set_config(self):
|
def set_config(self):
|
||||||
"""Sets all altered config values in the core"""
|
"""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
|
# Get the values from the dialog
|
||||||
new_core_config = {}
|
new_core_config = {}
|
||||||
new_gtkui_config = {}
|
new_gtkui_config = {}
|
||||||
|
@ -520,7 +524,7 @@ class Preferences(component.Component):
|
||||||
self.glade.get_widget("chk_start_in_tray").get_active()
|
self.glade.get_widget("chk_start_in_tray").get_active()
|
||||||
new_gtkui_config["lock_tray"] = \
|
new_gtkui_config["lock_tray"] = \
|
||||||
self.glade.get_widget("chk_lock_tray").get_active()
|
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()
|
self.glade.get_widget("txt_tray_password").get_text()).hexdigest()
|
||||||
if passhex != "c07eb5a8c0dc7bb81c217b67f11c3b7a5e95ffd7":
|
if passhex != "c07eb5a8c0dc7bb81c217b67f11c3b7a5e95ffd7":
|
||||||
new_gtkui_config["tray_password"] = passhex
|
new_gtkui_config["tray_password"] = passhex
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue