def _dump_mapfile(self): outpath = os.path.join(VENDOR_MAP_FOLDER, self._mappath) outf = VersionedOutputFile(outpath) outw = csv.writer(outf) outw.writerow(('Canonical', 'Strategy', 'Lparts')) for ident in self.get_idents(): outw.writerow([ident, (self.get_strategy(ident) or '')] + self.get_upartnos(ident) + ['@AG@' + x for x in self.get_apartnos(ident)]) outf.close() logger.info("Dumped {0} Vendor Map to File : {1}" "".format(self._name, outpath))
def export_audit(self, name): auditfname = os.path.join( AUDIT_PATH, 'materialslib-{0}.audit.csv'.format(name) ) outf = VersionedOutputFile(auditfname) outw = csv.writer(outf) outw.writerow(['filename', 'status', 'ident', 'description', 'path']) for material in self.materials: outw.writerow( [material.gname, material.status, material.ident, material.description, material.gpath] ) outf.close()
def _dump_mapfile(self): outpath = os.path.join(VENDOR_MAP_FOLDER, self._mappath) outf = VersionedOutputFile(outpath) outw = csv.writer(outf) outw.writerow(('Canonical', 'Strategy', 'Lparts')) for ident in self.get_idents(): outw.writerow( [ident, (self.get_strategy(ident) or '')] + self.get_upartnos(ident) + ['@AG@' + x for x in self.get_apartnos(ident)] ) outf.close() logger.info("Dumped {0} Vendor Map to File : {1}" "".format(self._name, outpath))
def write_out(self, f): vf = None if isinstance(f, basestring): vf = VersionedOutputFile(f) f = vf.as_file() # Header f.write('v {0} {1}\n'.format(self._gschver, self._filever)) # Write Elements for element in self._elements: element.write_out(f) if vf: vf.close()
def export_gsymlib_audit(): auditfname = os.path.join(AUDIT_PATH, 'gsymlib-audit.csv') outf = VersionedOutputFile(auditfname) outw = csv.writer(outf) outw.writerow([ 'filename', 'status', 'ident', 'device', 'value', 'footprint', 'description', 'path', 'package' ]) for symbol in gsymlib: outw.writerow([ symbol.fname, symbol.status, symbol.ident, symbol.device, symbol.value, symbol.footprint, symbol.description, symbol.fpath, symbol.package ]) outf.close()
def export_audit(self, name): auditfname = os.path.join(AUDIT_PATH, 'esymlib-{0}.audit.csv'.format(name)) outf = VersionedOutputFile(auditfname) outw = csv.writer(outf) outw.writerow([ 'filename', 'status', 'ident', 'device', 'value', 'footprint', 'description', 'path', 'package' ]) for symbol in self.symbols: outw.writerow([ symbol.gname, symbol.status, symbol.ident, symbol.device, symbol.value, symbol.footprint, symbol.description, symbol.gpath, symbol.package ]) outf.close()
def export_gsymlib_audit(): auditfname = os.path.join(AUDIT_PATH, "gsymlib-audit.csv") outf = VersionedOutputFile(auditfname) outw = csv.writer(outf) outw.writerow(["filename", "status", "ident", "device", "value", "footprint", "description", "path", "package"]) for symbol in gsymlib: outw.writerow( [ symbol.fname, symbol.status, symbol.ident, symbol.device, symbol.value, symbol.footprint, symbol.description, symbol.fpath, symbol.package, ] ) outf.close()