コード例 #1
0
 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")
コード例 #2
0
    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]]
コード例 #3
0
def GetWorksheetNameFromPotentialNakedWorksheetReference(nameOrNWRef):
    worksheetName = nameOrNWRef
    if isinstance(nameOrNWRef, ParseNode):
        worksheetName = nameOrNWRef.children[1]
        worksheetName += get_rstripped_part(nameOrNWRef.children[2])
    return worksheetName
コード例 #4
0
 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")
コード例 #5
0
def GetWorksheetNameFromPotentialNakedWorksheetReference(nameOrNWRef):
    worksheetName = nameOrNWRef
    if isinstance(nameOrNWRef, ParseNode):
        worksheetName = nameOrNWRef.children[1]
        worksheetName += get_rstripped_part(nameOrNWRef.children[2])
    return worksheetName
コード例 #6
0
 def whitespace(self):
     return get_rstripped_part(self.children[-1])