Update filter.py to Allow String Input for Filters
The proposed change takes advantage of the TextField class in the albow package to allow filters to accept string input from the user. May be of use to filter creators.
This commit is contained in:
parent
43cc541185
commit
2a2ddb344a
@ -1,15 +1,15 @@
|
||||
"""Copyright (c) 2010-2012 David Rio Vierra
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
"""Copyright (c) 2010-2012 David Rio Vierra
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE."""
|
||||
from toolbasics import *
|
||||
from albow.dialogs import wrapped_label
|
||||
@ -79,6 +79,13 @@ class FilterModuleOptions(Widget):
|
||||
elif optionType == "label":
|
||||
rows.append(wrapped_label(optionName, 50))
|
||||
|
||||
elif optionType == "string":
|
||||
field = TextField(value="string")
|
||||
self.optionDict[optionName] = AttrRef(field, 'value')
|
||||
|
||||
row = Row((Label(optionName), field))
|
||||
rows.append(row)
|
||||
|
||||
else:
|
||||
raise ValueError(("Unknown option type", optionType))
|
||||
|
||||
|
Reference in New Issue
Block a user