This commit is contained in:
Kovid Goyal 2011-09-20 19:56:08 -06:00
parent bdefb6b03c
commit 4569bd22d3

View File

@ -10,6 +10,7 @@ __docformat__ = 'restructuredtext en'
from calibre import as_unicode from calibre import as_unicode
# Forms {{{
class Control(object): class Control(object):
def __init__(self, qwe): def __init__(self, qwe):
@ -119,10 +120,10 @@ class Form(object):
def __getitem__(self, key): def __getitem__(self, key):
for x in self.input_controls: for x in self.input_controls:
if key == x.name: if key == x.name:
return x return x.value
for x in (self.radio_controls, self.select_controls): for x in (self.radio_controls, self.select_controls):
try: try:
return x[key] return x[key].value
except KeyError: except KeyError:
continue continue
raise KeyError('No control with the name %s in this form'%key) raise KeyError('No control with the name %s in this form'%key)
@ -158,7 +159,7 @@ class Form(object):
if c.type == 'image': if c.type == 'image':
return c return c
# }}}
class FormsMixin(object): class FormsMixin(object):