summaryrefslogtreecommitdiff
path: root/lib/param/json.py
blob: 08db3e9e4b847299e57b35f4d0c649af4a9fede8 (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)