diff options
Diffstat (limited to 'htpasswd.py')
-rwxr-xr-x[-rw-r--r--] | htpasswd.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/htpasswd.py b/htpasswd.py index 3641c34..0b79445 100644..100755 --- a/htpasswd.py +++ b/htpasswd.py | |||
@@ -8,7 +8,8 @@ Released under the terms of the BSD license. | |||
8 | A collection of classes and functions to manipulate apache htaccess files. | 8 | A collection of classes and functions to manipulate apache htaccess files. |
9 | """ | 9 | """ |
10 | 10 | ||
11 | __all__ = [ "generate_user" ] | 11 | __all__ = ["generate_user"] |
12 | |||
12 | 13 | ||
13 | def hash_password(passwd, ctype="crypt"): | 14 | def hash_password(passwd, ctype="crypt"): |
14 | """Create an Apache-style password hash. | 15 | """Create an Apache-style password hash. |
@@ -25,10 +26,11 @@ def hash_password(passwd, ctype="crypt"): | |||
25 | elif ctype is "md5": | 26 | elif ctype is "md5": |
26 | from apachelib.password import md5_password | 27 | from apachelib.password import md5_password |
27 | return md5_password(passwd) | 28 | return md5_password(passwd) |
28 | 29 | ||
29 | # We should never get here | 30 | # We should never get here |
30 | raise ValueError("%s is not a valid value for ctype." % ctype) | 31 | raise ValueError("%s is not a valid value for ctype." % ctype) |
31 | 32 | ||
33 | |||
32 | def generate_user(username, passwd, ctype="crypt"): | 34 | def generate_user(username, passwd, ctype="crypt"): |
33 | """Generate a single htaccess line. | 35 | """Generate a single htaccess line. |
34 | """ | 36 | """ |