def __iter__(self): for item in self.previous: yield item for name in sorted(os.listdir(self.path)): if name.startswith('.') or not name.endswith('.json'): continue path = os.path.join(self.path, name) if not os.path.isfile(path): continue locals()['__traceback_info__'] = path with open(path) as file_: data = json.loads(file_.read()) for item in data: # yield item yield recursive_encode(item)
def __iter__(self): for item in self.previous: yield item msg = 'Importing content_creation files with inflator.' for name in ProgressLogger(msg, sorted(os.listdir(self.path))): if name.startswith('.') or not name.endswith('.json'): continue path = os.path.join(self.path, name) if not os.path.isfile(path): continue locals()['__traceback_info__'] = path with open(path) as file_: data = json.loads(file_.read()) for item in data: # yield item yield recursive_encode(item)
def equals(self, input, output): self.assertEqual(recursive_encode(input), output)
def __iter__(self): for item in self.previous: yield item yield recursive_encode(self.options['item'])