mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-15 14:05:57 +00:00
move from sha module to hashlib module for 2.6 support
This commit is contained in:
parent
bbddd29d4b
commit
67ee5000ad
@ -417,7 +417,7 @@ 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 sha
|
import hashlib
|
||||||
# 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,8 +520,8 @@ 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 = sha.new(self.glade.get_widget("txt_tray_password").get_text())\
|
passhex = hashlib.sha1(\
|
||||||
.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
|
||||||
new_gtkui_config["classic_mode"] = \
|
new_gtkui_config["classic_mode"] = \
|
||||||
|
@ -336,7 +336,7 @@ class SystemTray(component.Component):
|
|||||||
self.build_tray_bwsetsubmenu()
|
self.build_tray_bwsetsubmenu()
|
||||||
|
|
||||||
def unlock_tray(self, is_showing_dlg=[False]):
|
def unlock_tray(self, is_showing_dlg=[False]):
|
||||||
import sha
|
import hashlib
|
||||||
log.debug("Show tray lock dialog")
|
log.debug("Show tray lock dialog")
|
||||||
result = False
|
result = False
|
||||||
|
|
||||||
@ -363,8 +363,8 @@ window, please enter your password"))
|
|||||||
tray_lock.vbox.pack_start(entered_pass)
|
tray_lock.vbox.pack_start(entered_pass)
|
||||||
tray_lock.show_all()
|
tray_lock.show_all()
|
||||||
if tray_lock.run() == gtk.RESPONSE_ACCEPT:
|
if tray_lock.run() == gtk.RESPONSE_ACCEPT:
|
||||||
if self.config["tray_password"] == sha.new(entered_pass.get_text())\
|
if self.config["tray_password"] == hashlib.sha1(\
|
||||||
.hexdigest():
|
entered_pass.get_text()).hexdigest():
|
||||||
result = True
|
result = True
|
||||||
tray_lock.destroy()
|
tray_lock.destroy()
|
||||||
is_showing_dlg[0] = False
|
is_showing_dlg[0] = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user