def get_dom(filename): if filename not in _cache: design = get_design(filename) eaglexml = EagleXML() for ci in design.component_instances: eaglexml.inst2cpt[ci.instance_id] = ci.library_id _cache[filename] = eaglexml.make_dom(design) return _cache[filename]
def test_write(self): """ We can write out a complete design file. """ writer = EagleXML() filedesc, filename = tempfile.mkstemp() os.close(filedesc) os.remove(filename) writer.write(self.design, filename) self.assertTrue(os.path.exists(filename)) os.remove(filename)