def test_get_rstripped_part(self): self.assertEquals(get_rstripped_part("foo "), " ", "get_r_stripped_part broken") self.assertEquals(get_rstripped_part(" foo "), " ", "get_r_stripped_part broken") self.assertEquals(get_rstripped_part(""), "", "get_r_stripped_part broken")
def __setWorksheet(self, ws): if ws is None: self.children = [self.children[-1]] return ws = quote_fl_worksheet_name(ws) if self.worksheetReference: self.children[0] = ws + get_rstripped_part(self.children[0]) else: self.children = [ws, '!', self.children[-1]]
def GetWorksheetNameFromPotentialNakedWorksheetReference(nameOrNWRef): worksheetName = nameOrNWRef if isinstance(nameOrNWRef, ParseNode): worksheetName = nameOrNWRef.children[1] worksheetName += get_rstripped_part(nameOrNWRef.children[2]) return worksheetName
def whitespace(self): return get_rstripped_part(self.children[-1])