summaryrefslogtreecommitdiff
path: root/lib/param/json.py
blob: c72cb110cfada96e2f35531a2657b114f99ffa38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""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)
        if value:
            self.value = json.loads(value)