def get_state_structure(P_STATES_TYPE_NAME): dict_ref = census_resources.get_dict_ref() dict_structure = dict() for i in range(0, len(dict_ref['state_2digits'])): name = dict_ref['state_fullname_w1'][i] twodigits = dict_ref['state_2digits'][i] twoletters = dict_ref['state_2letters'][i] structure = {u'attributes': {u'state_2digits': twodigits ,u'state_2letters': twoletters ,u'state_fullname_w1': name }} if P_STATES_TYPE_NAME =='state_2digits': dict_structure[twodigits]=structure elif P_STATES_TYPE_NAME =='state_fullname_w1': dict_structure[name]=structure elif P_STATES_TYPE_NAME =='state_2letters': dict_structure[twoletters]=structure return dict_structure
def __init__(self, config, plugin_config): Connector.__init__( self, config, plugin_config) # pass the parameters to the base class self.t__ = census_resources.get_dict_ref()