mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
bdefb6b03c
commit
4569bd22d3
@ -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):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user