def check_file(self, filename): with open(filename) as f: metadata = archieml.load(f) test = metadata['test'] expected = json.loads(metadata['result']) with open(filename) as f: actual = archieml.load(f) del actual['test'] del actual['result'] self.assertEqual(expected, actual, ('{}\n' 'expected: {}\n' 'actual : {}').format(test, expected, actual))
def get_extra_context(): print ">>>>> PARSING NEW STORY" call(["node", "scripts/js_parser.js", "out_drive.html"]) # parse the html before loading it into archieML with open('./out_parsed.txt') as f: data = archieml.load(f) data = dict(data) return data
def get_extra_context(): call(["node", "node_scripts/js_parser.js", "out_drive.html"]) # parse the html before loading it into archieML with open('out_parsed.txt') as f: data = archieml.load(f) data = dict(data) return data
def check_file(self, filename): with open(filename) as f: metadata = archieml.load(f) test = metadata['test'] expected = json.loads(metadata['result']) with open(filename) as f: actual = archieml.load(f) del actual['test'] del actual['result'] self.assertEqual(expected, actual, ( '{}\n' 'expected: {}\n' 'actual : {}' ).format(test, expected, actual))
def process(infile): infile_minus = infile.split('/')[-1] with open(infile) as f: data = archieml.load(f) data2 = json.loads(json.dumps(data)) return data2
def load(self): """ Parses the downloaded Excel file. """ try: with open(self._filename) as f: doc = archieml.load(f) except IOError: raise CopyException('"%s" does not exist. Have you run "fab update_copy"?' % self._filename) for section in doc: self._copy[section] = Section(section, doc[section])
def get_meta(): path = BAKER_DIR.joinpath("meta.aml") with open(path) as f: data = archieml.load(f) return data