summaryrefslogtreecommitdiff
path: root/passlib/ext/django/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'passlib/ext/django/utils.py')
-rw-r--r--passlib/ext/django/utils.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/passlib/ext/django/utils.py b/passlib/ext/django/utils.py
index 72e50ae..098dbe4 100644
--- a/passlib/ext/django/utils.py
+++ b/passlib/ext/django/utils.py
@@ -1,7 +1,7 @@
"""passlib.ext.django.utils - helper functions used by this plugin"""
-#===================================================================
-#imports
-#===================================================================
+#=============================================================================
+# imports
+#=============================================================================
# core
import logging; log = logging.getLogger(__name__)
from weakref import WeakKeyDictionary
@@ -25,9 +25,9 @@ __all__ = [
"get_passlib_hasher",
]
-#===================================================================
+#=============================================================================
# default policies
-#===================================================================
+#=============================================================================
def get_preset_config(name):
"""Returns configuration string for one of the preset strings
supported by the ``PASSLIB_CONFIG`` setting.
@@ -92,9 +92,9 @@ superuser__sha512_crypt__default_rounds = 120000
superuser__django_pbkdf2_sha256__default_rounds = 15000
"""
-#===================================================================
+#=============================================================================
# translating passlib names <-> hasher names
-#===================================================================
+#=============================================================================
# prefix used to shoehorn passlib's handler names into hasher namespace
# (allows get_hasher() to be meaningfully called even if passlib handler
@@ -129,9 +129,9 @@ def hasher_to_passlib_name(hasher_name):
raise ValueError("can't translate hasher name to passlib name: %r" %
hasher_name)
-#===================================================================
+#=============================================================================
# wrapping passlib handlers as django hashers
-#===================================================================
+#=============================================================================
_FAKE_SALT = "--fake-salt--"
class _HasherWrapper(object):
@@ -229,9 +229,9 @@ def _get_hasher(algorithm):
get_hasher = module._manager.getorig("django.contrib.auth.hashers:get_hasher")
return get_hasher(algorithm)
-#===================================================================
+#=============================================================================
# adapting django hashers -> passlib handlers
-#===================================================================
+#=============================================================================
# TODO: this code probably halfway works, mainly just needs
# a routine to read HASHERS and PREFERRED_HASHER.
@@ -322,9 +322,9 @@ def _get_hasher(algorithm):
## register_crypt_handler(handler)
## return handler
-#===================================================================
+#=============================================================================
# monkeypatch helpers
-#===================================================================
+#=============================================================================
# private singleton indicating lack-of-value
_UNSET = object()
@@ -465,6 +465,6 @@ class _PatchManager(object):
# eoc
#===================================================================
-#===================================================================
-#eof
-#===================================================================
+#=============================================================================
+# eof
+#=============================================================================