diff --git a/gnuviechadmin/util/stmtcreator.py b/gnuviechadmin/util/stmtcreator.py index 9e5270f..7cae25c 100644 --- a/gnuviechadmin/util/stmtcreator.py +++ b/gnuviechadmin/util/stmtcreator.py @@ -23,12 +23,15 @@ """This is an SQL statement creator as a prototype for mail account creation.""" -if __name__ == '__main___': - from passwordutils import * +if __name__ == '__main__': + from passwordutils import get_pw_tuple import sys - for line in sys.stdin.read().splitlines(): + for line in sys.stdin.readlines(): parts = line.split() + if len(parts) < 4: + raise ValueError("""lines must consist of the elements: +email@domain username uid domainid""") (email, domain) = parts[0].split("@") username = parts[1][0:5] pwtuple = get_pw_tuple()