def addFileRegexps(self,fName): """Adds the lines from a file to the custom regular expressions :param fName: The name of the file""" f=open(fName) txt=f.read() f.close() self.lines_+=readCustomPlotInfo(txt)
def addFileRegexps(self,fName): """Adds the lines from a file to the custom regular expressions @param fName: The name of the file""" f=open(fName) txt=f.read() f.close() self.lines_+=readCustomPlotInfo(txt)
def addPlotLines(self,lines,name=None): """Adds a list of lines""" if lines: for i,l in enumerate(lines): if name: useName="%s_%i" % (name,i) else: useName=None self.lines_+=readCustomPlotInfo(l,useName=useName)
def addPlotLines(self,lines,name=None): """Adds a list of lines""" if lines: for i,l in enumerate(lines): if name: useName="%s_%i" % (name,i) else: useName=None self.lines_+=readCustomPlotInfo(l,useName=useName)
def addPlotLine(self,line): """Add a single line""" self.lines_+=readCustomPlotInfo(line)
def testNewStyle(self): ci = readCustomPlotInfo(newStyle) self.assertEqual(len(ci), 1) ci = readCustomPlotInfo(newStyle2) self.assertEqual(len(ci), 2)
def testPyDictRegexp(self): ci = readCustomPlotInfo(pyDictRegexp) self.assertEqual(len(ci), 1) ci = readCustomPlotInfo(pyDictRegexp2) self.assertEqual(len(ci), 2)
def testPureRegex(self): ci = readCustomPlotInfo(pureRegexp) self.assertEqual(len(ci), 1) ci = readCustomPlotInfo(pureRegexp2) self.assertEqual(len(ci), 2)
def addPlotLine(self,line): """Add a single line""" self.lines_+=readCustomPlotInfo(line)
def testNewStyle(self): ci=readCustomPlotInfo(newStyle) self.assertEqual(len(ci),1) ci=readCustomPlotInfo(newStyle2) self.assertEqual(len(ci),2)
def testPyDictRegexp(self): ci=readCustomPlotInfo(pyDictRegexp) self.assertEqual(len(ci),1) ci=readCustomPlotInfo(pyDictRegexp2) self.assertEqual(len(ci),2)
def testPureRegex(self): ci=readCustomPlotInfo(pureRegexp) self.assertEqual(len(ci),1) ci=readCustomPlotInfo(pureRegexp2) self.assertEqual(len(ci),2)