strings compatible with python 3.2
This commit is contained in:
parent
a562af8abc
commit
c56d0ad718
6 changed files with 17 additions and 17 deletions
|
@ -3,13 +3,13 @@ from wtforms import StringField, validators, SubmitField, ValidationError
|
||||||
|
|
||||||
|
|
||||||
class ScriptAudioForm(Form):
|
class ScriptAudioForm(Form):
|
||||||
nick = StringField(u'Audio nick', validators=[validators.required()],
|
nick = StringField('Audio nick', validators=[validators.required()],
|
||||||
description='A simple name to recognize this audio')
|
description='A simple name to recognize this audio')
|
||||||
name = StringField(u'Name', validators=[validators.required()],
|
name = StringField('Name', validators=[validators.required()],
|
||||||
description='filename (NOT path) of the script')
|
description='filename (NOT path) of the script')
|
||||||
args = StringField(u'Arguments',
|
args = StringField('Arguments',
|
||||||
description='arguments, separated by spaces')
|
description='arguments, separated by spaces')
|
||||||
submit = SubmitField(u'Submit')
|
submit = SubmitField('Submit')
|
||||||
|
|
||||||
def populate_from_audiospec(self, audiospec):
|
def populate_from_audiospec(self, audiospec):
|
||||||
if 'nick' in audiospec:
|
if 'nick' in audiospec:
|
||||||
|
|
|
@ -5,11 +5,11 @@ from wtforms import StringField, validators, SubmitField
|
||||||
|
|
||||||
|
|
||||||
class StaticAudioForm(Form):
|
class StaticAudioForm(Form):
|
||||||
nick = StringField(u'Audio nick', validators=[validators.required()],
|
nick = StringField('Audio nick', validators=[validators.required()],
|
||||||
description='A simple name to recognize this audio')
|
description='A simple name to recognize this audio')
|
||||||
path = StringField(u'Path', validators=[validators.required()],
|
path = StringField('Path', validators=[validators.required()],
|
||||||
description='Full path to audio file')
|
description='Full path to audio file')
|
||||||
submit = SubmitField(u'Submit')
|
submit = SubmitField('Submit')
|
||||||
|
|
||||||
def populate_from_audiospec(self, audiospec):
|
def populate_from_audiospec(self, audiospec):
|
||||||
if 'nick' in audiospec:
|
if 'nick' in audiospec:
|
||||||
|
|
|
@ -46,4 +46,4 @@ def generate(spec):
|
||||||
prefix='audiogen-randomdir-')
|
prefix='audiogen-randomdir-')
|
||||||
os.close(tmp[0])
|
os.close(tmp[0])
|
||||||
shutil.copy(path, tmp[1])
|
shutil.copy(path, tmp[1])
|
||||||
yield u'file://{}'.format(tmp[1])
|
yield 'file://{}'.format(tmp[1])
|
||||||
|
|
|
@ -21,4 +21,4 @@ def generate(spec):
|
||||||
prefix='audiogen-static-')
|
prefix='audiogen-static-')
|
||||||
os.close(tmp[0])
|
os.close(tmp[0])
|
||||||
shutil.copy(path, tmp[1])
|
shutil.copy(path, tmp[1])
|
||||||
yield u'file://{}'.format(tmp[1])
|
yield 'file://{}'.format(tmp[1])
|
||||||
|
|
|
@ -7,21 +7,21 @@ from wtforms import StringField, DateTimeField, validators, \
|
||||||
|
|
||||||
|
|
||||||
class FrequencyAlarmForm(Form):
|
class FrequencyAlarmForm(Form):
|
||||||
nick = StringField(u'Alarm nick', validators=[validators.required()],
|
nick = StringField('Alarm nick', validators=[validators.required()],
|
||||||
description='A simple name to recognize this alarm')
|
description='A simple name to recognize this alarm')
|
||||||
start = DateTimeField(u'Start date and time',
|
start = DateTimeField('Start date and time',
|
||||||
validators=[validators.required()],
|
validators=[validators.required()],
|
||||||
description='Date before which no alarm will ring, '
|
description='Date before which no alarm will ring, '
|
||||||
'expressed as YYYY-MM-DD HH:MM:SS')
|
'expressed as YYYY-MM-DD HH:MM:SS')
|
||||||
end = DateTimeField(u'End date and time',
|
end = DateTimeField('End date and time',
|
||||||
validators=[validators.optional()],
|
validators=[validators.optional()],
|
||||||
description='Date after which no alarm will ring, '
|
description='Date after which no alarm will ring, '
|
||||||
'expressed as YYYY-MM-DD HH:MM:SS')
|
'expressed as YYYY-MM-DD HH:MM:SS')
|
||||||
interval = StringField(u'Frequency',
|
interval = StringField('Frequency',
|
||||||
validators=[validators.required()],
|
validators=[validators.required()],
|
||||||
description='in seconds, or human-readable '
|
description='in seconds, or human-readable '
|
||||||
'(like 9w3d12h)')
|
'(like 9w3d12h)')
|
||||||
submit = SubmitField(u'Submit')
|
submit = SubmitField('Submit')
|
||||||
|
|
||||||
def populate_from_timespec(self, timespec):
|
def populate_from_timespec(self, timespec):
|
||||||
if 'nick' in timespec:
|
if 'nick' in timespec:
|
||||||
|
|
|
@ -5,12 +5,12 @@ from wtforms import StringField, DateTimeField, validators, SubmitField
|
||||||
|
|
||||||
|
|
||||||
class SingleAlarmForm(Form):
|
class SingleAlarmForm(Form):
|
||||||
nick = StringField(u'Alarm nick', validators=[validators.required()],
|
nick = StringField('Alarm nick', validators=[validators.required()],
|
||||||
description='A simple name to recognize this alarm')
|
description='A simple name to recognize this alarm')
|
||||||
dt = DateTimeField(u'Date and time', validators=[validators.required()],
|
dt = DateTimeField('Date and time', validators=[validators.required()],
|
||||||
description='Date to ring on, expressed as '
|
description='Date to ring on, expressed as '
|
||||||
'YYYY-MM-DD HH:MM:SS')
|
'YYYY-MM-DD HH:MM:SS')
|
||||||
submit = SubmitField(u'Submit')
|
submit = SubmitField('Submit')
|
||||||
|
|
||||||
def populate_from_timespec(self, timespec):
|
def populate_from_timespec(self, timespec):
|
||||||
if 'nick' in timespec:
|
if 'nick' in timespec:
|
||||||
|
|
Loading…
Reference in a new issue