def __init__(self, js, onload=True): if os.path.isfile(js): js = File(js) if isinstsafe(js, File): if js.ext == 'coffee': js = js.coffee2js() js = js.read() self._raw = js self._onload = onload
def inTags(fd): tagFile = File(fd['dataFile']).resrepext(FigData.TAG_EXT) if not tagFile: return False return filter in [s.lower() for s in json.loads( tagFile.read() )]