diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-09-28 22:23:20 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2011-09-28 22:28:12 +0200 |
commit | a537ee33121b7f43966661c37e13682524820983 (patch) | |
tree | bdf3f0408e9686e3ce3ee532973f835a5ef607e8 /util.py | |
parent | 94897110886c6af645260a39c70c244e7e69fce2 (diff) | |
download | sites-a537ee33121b7f43966661c37e13682524820983.tar.gz sites-a537ee33121b7f43966661c37e13682524820983.tar.bz2 sites-a537ee33121b7f43966661c37e13682524820983.zip |
added config, externalized util
added external config file (usage from multiple own modules)
externalized some functions to seperate module
Diffstat (limited to 'util.py')
-rw-r--r-- | util.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- +import config + +import web from random import Random rng = Random() @@ -17,6 +20,15 @@ def generate_char(i, alternate_hands): else: return rng.choice(righthand) + def generate_password(length = 8, alternate_hands = True): return ''.join([generate_char(i, alternate_hands) for i in xrange(length)]) + +def validate_listname(name): + for regex in config.reserved_names: + if re.search(regex, name): + return False + return True + + |