summaryrefslogtreecommitdiffstats
path: root/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'util.py')
-rw-r--r--util.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/util.py b/util.py
index 7051134..e375aa1 100644
--- a/util.py
+++ b/util.py
@@ -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
+
+