CoCalc Public Fileswww / cgi-bin / mfd / misc
Author: William A. Stein
Compute Environment: Ubuntu 18.04 (Deprecated)
1##### ???? what's this for???? - WAS (Nov 2001)
2def ModSymForm(form):
3    if not form.has_key("level"):
4        level = 1
5    else:
6        if len(form["level"].value) > 5:
7            print "<h1>Error</h1>"
8            print "The level N=%s is too large." % form["level"].value
9            return 0
10        if int(form["level"].value) <= 0:
11            print "<h1>Error</h1>"
12            print "The level N=%s is negative." % form["level"].value
13            return 0
14        level = form["level"].value
15
16    if not form.has_key("weight"):
17        weight = 2
18    else:
19        if len(form["weight"].value) > 4:
20            print "<h1>Error</h1>"
21            print "The weight k=%s is too large." % form["weight"].value
22            return 0
23        if int(form["weight"].value) <= 0:
24            print "<h1>Error</h1>"
25            print "The weight k=%s is negative." % form["weight"].value
26            return 0
27        weight = form["weight"].value
28
29    if not form.has_key("iso_class"):
30        iso_class = 0
31    else:
32        if len(form["iso_class"].value) > 9999:
33            print "<h1>Error</h1>"
34            print "The iso_class %s is too large." % form["iso_class"].value
35            return 0
36        if int(form["iso_class"].value) < 0:
37            print "<h1>Error</h1>"
38            print "The iso_class i=%s is negative." % form["iso_class"].value
39            return 0
40        iso_class = form["iso_class"].value
41
42    if not form.has_key("dirchar"):
43        dirchar = '1'
44    else:
45        dirchar = form["dirchar"].value
46
47    if not form.has_key("base_field"):
48        base_field = 'Q'
49    else:
50        base_field = form["base_field"].value
51
52    return ModSym(level,weight,iso_class,dirchar,base_field)
53
54
55
56
57
58