Source code for bw2data.backends.json.mapping

# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from eight import *

from ...serialization import PickledDict

[docs] cache = {}
[docs] class KeyMapping(PickledDict):
[docs] filename = "keys-filenames.mapping"
[docs] def get_mapping(filepath): if filepath not in cache: cache[filepath] = KeyMapping(filepath) return cache[filepath]