Changeset 4afd1fa
- Timestamp:
- 07/05/2014 06:43:07 PM (11 years ago)
- Branches:
- 2.0.x, develop, master
- Children:
- 30e5fc
- Parents:
- c57220
- Location:
- deluge
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
deluge/common.py
rc57220 r4afd1fa 862 862 import configmanager 863 863 import random 864 from hashlib import sha1 as sha 865 864 866 auth_file = configmanager.get_config_dir("auth") 865 867 if not os.path.exists(auth_file): 866 868 create_auth_file() 867 869 868 try:869 from hashlib import sha1 as sha_hash870 except ImportError:871 from sha import new as sha_hash872 870 fd = open(auth_file, "a" if append else "w") 873 871 fd.write(":".join([ 874 872 "localclient", 875 sha _hash(str(random.random())).hexdigest(),873 sha(str(random.random())).hexdigest(), 876 874 str(AUTH_LEVEL_ADMIN) 877 875 ]) + '\n') -
deluge/tests/test_core.py
rc57220 r4afd1fa 1 1 import os 2 2 import warnings 3 4 try: 5 from hashlib import sha1 as sha 6 except ImportError: 7 from sha import sha 3 from hashlib import sha1 as sha 8 4 9 5 from twisted.trial import unittest -
deluge/ui/common.py
rc57220 r4afd1fa 43 43 import logging 44 44 import urlparse 45 46 45 import locale 47 48 try: 49 from hashlib import sha1 as sha 50 except ImportError: 51 from sha import sha 46 from hashlib import sha1 as sha 52 47 53 48 from deluge import bencode -
deluge/ui/gtkui/preferences.py
rc57220 r4afd1fa 40 40 import gtk 41 41 import logging 42 from hashlib import sha1 as sha 42 43 43 44 import deluge.component as component … … 542 543 :param hide: bool, if True, will not re-show the dialog and will hide it instead 543 544 """ 544 try:545 from hashlib import sha1 as sha_hash546 except ImportError:547 from sha import new as sha_hash548 549 545 classic_mode_was_set = self.gtkui_config["classic_mode"] 550 546 … … 663 659 new_gtkui_config["lock_tray"] = \ 664 660 self.builder.get_object("chk_lock_tray").get_active() 665 passhex = sha _hash(self.builder.get_object("txt_tray_password").get_text()).hexdigest()661 passhex = sha(self.builder.get_object("txt_tray_password").get_text()).hexdigest() 666 662 if passhex != "c07eb5a8c0dc7bb81c217b67f11c3b7a5e95ffd7": 667 663 new_gtkui_config["tray_password"] = passhex -
deluge/ui/gtkui/systemtray.py
rc57220 r4afd1fa 438 438 439 439 def unlock_tray(self, is_showing_dlg=[False]): 440 try: 441 from hashlib import sha1 as sha_hash 442 except ImportError: 443 from sha import new as sha_hash 440 from hashlib import sha1 as sha 444 441 445 442 log.debug("Show tray lock dialog") … … 489 486 def on_response(dialog, response_id): 490 487 if response_id == gtk.RESPONSE_OK: 491 if self.config["tray_password"] == sha _hash(entered_pass.get_text()).hexdigest():488 if self.config["tray_password"] == sha(entered_pass.get_text()).hexdigest(): 492 489 self.window.present() 493 490
Note:
See TracChangeset
for help on using the changeset viewer.