Commit b3a426d7 authored by Clément Schreiner's avatar Clément Schreiner
Browse files

Fix string_field property

 - 'string_field' was missing from __all__
 - use operator.itemgetter instead of trivial getter function
parent 61fb096e
......@@ -42,11 +42,13 @@ __all__ = ['importercmd',
'QAPlugin',
'PluginResult',
'bool_field',
'int_field']
'int_field',
'string_field']
import os.path
import logging
from inspect import getmembers, ismethod
import operator
from pylons import config
# template rendering
......@@ -147,13 +149,11 @@ def string_field(name):
"""
Property for accessing a string item from the plugin result's dictionary.
"""
def fget(instance):
return instance.get(name, "")
def fset(instance, value):
instance[name] = value
return property(fget, fset, _fdel(name))
return property(operator.itemgetter(name), fset, _fdel(name))
#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment