This repository has been archived by the owner on Apr 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
36 lines (26 loc) · 1.64 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import conf
import collections
from flask_wtf import Form
from wtforms import FileField, SelectField, BooleanField
from wtforms.validators import InputRequired
class ProcessForm(Form):
RELEASE_OPTIONS = [(v, k) for k, v in conf.RELEASES.items()] + [['local-source', "Local Canonicalized Driver File"]]
# RELEASE_OPTIONS = [('schema-2013', "MEI 2013 (v{0})".format(conf.LATEST_TAG_2013)),
# ('schema-2012', "MEI 2012 (v{0})".format(conf.LATEST_TAG_2012)),
# ('schema-latest', 'Latest from Development Branch'),
# ('local-source', "Local Canonicalized Driver File")]
CUSTOMIZATION_OPTIONS = [(k, conf.AVAILABLE_CUSTOMIZATIONS[k][0]) for k in sorted(conf.AVAILABLE_CUSTOMIZATIONS)]
schema_language = SelectField(u'Schema Language',
choices=[('relaxng', 'RelaxNG Schema'),
('compiledodd', 'Compiled ODD'),
('documentation', 'HTML Documentation')],
validators=[InputRequired()])
source_options = SelectField(u'MEI Release',
choices=RELEASE_OPTIONS,
validators=[InputRequired()])
source_canonical_file = FileField(u"Canonicalized Driver File")
customization_options = SelectField(u"MEI Customization",
choices=CUSTOMIZATION_OPTIONS,
validators=[InputRequired()])
local_customization_file = FileField(u"Customization File")
verbose_output = BooleanField(u'Verbose output')