def prt_txt(self, prt=sys.stdout): """Print an ASCII text format.""" prtfmt = self.objprtfmt.get_prtfmt_str(self.flds_cur) prt.write("{FLDS}\n".format(FLDS=" ".join(self.flds_cur))) WrSectionsTxt.prt_sections(prt, self.desc2nts['sections'], prtfmt, secspc=True)
def prt_nts(self, desc2nts, prt=sys.stdout, prtfmt=None): """Print grouped and sorted GO IDs.""" # deprecated # Set print format string if prtfmt is None: prtfmt = "{{hdr1usr01:2}} {FMT}\n".format(FMT=self.grprobj.gosubdag.prt_attr['fmt']) # 1-D: data to print is a flat list of namedtuples if 'flat' in desc2nts: prt_txt(prt, desc2nts['flat'], prtfmt=prtfmt) # 2-D: data to print is a list of [(section, nts), ... else: WrSectionsTxt.prt_sections(prt, desc2nts['sections'], prtfmt)
def prt_nts(self, desc2nts, prt=sys.stdout, prtfmt=None): """Print grouped and sorted GO IDs.""" # deprecated # Set print format string if prtfmt is None: prtfmt = "{{hdr1usr01:2}} {FMT}\n".format( FMT=self.grprobj.gosubdag.prt_attr['fmt']) # 1-D: data to print is a flat list of namedtuples if 'flat' in desc2nts: prt_txt(prt, desc2nts['flat'], prtfmt=prtfmt) # 2-D: data to print is a list of [(section, nts), ... else: WrSectionsTxt.prt_sections(prt, desc2nts['sections'], prtfmt)