From f134d8b1d610cb5326a1a92bdc3e72355614c6b2 Mon Sep 17 00:00:00 2001 From: Mateusz Sikora Date: Wed, 8 Oct 2014 10:29:22 +0200 Subject: [PATCH] remove unused utils.py --- rest_auth/utils.py | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 rest_auth/utils.py diff --git a/rest_auth/utils.py b/rest_auth/utils.py deleted file mode 100644 index 4b76312..0000000 --- a/rest_auth/utils.py +++ /dev/null @@ -1,43 +0,0 @@ -from django.utils.crypto import get_random_string - - -HASH_CHARACTERS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' - - -def generate_new_hash_with_length(length): - """ - Generates a random string with the alphanumerical character set and given length. - """ - return get_random_string(length, HASH_CHARACTERS) - - -# Based on http://stackoverflow.com/a/547867. Thanks! Credit goes to you! -def construct_modules_and_import(name): - """ - Grab the Python string to import - """ - - # Get all the components by dot notations - components = name.split('.') - module = '' - i = 1 - - # Construct the partial Python string except the last package name - for comp in components: - if i < len(components): - module += str(comp) - - if i < (len(components) - 1): - module += '.' - - i += 1 - - # Import the module from above python string - mod = __import__(module) - - # Import the component recursivcely - for comp in components[1:]: - mod = getattr(mod, comp) - - # Return the imported module's class - return mod