summaryrefslogtreecommitdiff
path: root/lib/param/json.py
blob: 4fa493355cc22f211143214107d93bb721fff333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""Defines the json param type"""
from .param import Param
import simplejson as json

class Json(Param):
    """Defines the json param type. Loads in a
    json value and parses it.

    Args:
        value: a json string
        classname: name of the class to which the param belongs
    """
    def __init__(self, value, classname=""):
        super(Json, self).__init__(classname=classname)
        self.value = json.loads(value)