當前位置: 首頁>>代碼示例>>Python>>正文


Python parse_node.ParseNode類代碼示例

本文整理匯總了Python中dirigible.sheet.parser.parse_node.ParseNode的典型用法代碼示例。如果您正苦於以下問題:Python ParseNode類的具體用法?Python ParseNode怎麽用?Python ParseNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ParseNode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testRegisteredWithParse

 def testRegisteredWithParse(self):
     "test registered with ParseNode"
     self.assertEquals(
         type(ParseNode.construct_node(ParseNode.FL_CELL_RANGE, ["a1", ":", "b4"])),
         FLCellRangeParseNode,
         "Class is not registered with ParseNode",
     )
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:7,代碼來源:test_fl_cell_range_parse_node.py

示例2: __init__

 def __init__(self, children):
     assert len(children) == 3
     ParseNode.__init__(self, ParseNode.FL_CELL_RANGE, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:3,代碼來源:fl_cell_range_parse_node.py

示例3: property

    localReference = property(__getLocalReference, __setLocalReference)


    @property
    def coords(self):
        return cell_name_to_coordinates(self.plainCellName)


    def offset(self, dx, dy, move_absolute=False):
        (col, row) = cell_name_to_coordinates(self.plainCellName)

        if move_absolute or not self.colAbsolute:
            col += dx
        if move_absolute or not self.rowAbsolute:
            row += dy

        newName = coordinates_to_cell_name(col, row, colAbsolute=self.colAbsolute, rowAbsolute=self.rowAbsolute)
        if newName is None:
            newName = "#Invalid!"

        self.localReference = newName + self.whitespace


    def canonicalise(self, wsNames):
        self.localReference = self.localReference.upper()
        FLReferenceParseNode.canonicalise(self, wsNames)


ParseNode.register_node_type(ParseNode.FL_CELL_REFERENCE, FLCellReferenceParseNode)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:29,代碼來源:fl_cell_reference_parse_node.py

示例4: rowIndex

    @property
    def rowIndex(self):
        return int(self.plainRowName)


    @property
    def coords(self):
        return 0, self.rowIndex


    def offset(self, _, count, moveAbsolute=False):
        if not moveAbsolute and self.isAbsolute:
            return
        newIndex = self.rowIndex + count
        if newIndex > 0:
            self.plainRowName = str(newIndex)
        else:
            self.localReference = '#Invalid!' + self.whitespace


    def __getLocalReference(self):
        return self.children[-1]
    def __setLocalReference(self, newRow):
        self.children[-1] = newRow
    localReference = property(__getLocalReference, __setLocalReference)


ParseNode.register_node_type(ParseNode.FL_ROW_REFERENCE, FLRowReferenceParseNode)

開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:28,代碼來源:fl_row_reference_parse_node.py

示例5: ListMaker

def ListMaker(children):
    return ParseNode.construct_node(ParseNode.LIST_MAKER, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例6: ListIf

def ListIf(children):
    return ParseNode.construct_node(ParseNode.LIST_IF, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例7: Expr

def Expr(children):
    return ParseNode.construct_node(ParseNode.EXPR, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例8: DictMaker

def DictMaker(children):
    return ParseNode.construct_node(ParseNode.DICT_MAKER, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例9: CompOperator

def CompOperator(children):
    return ParseNode.construct_node(ParseNode.COMP_OPERATOR, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例10: Comparison

def Comparison(children):
    return ParseNode.construct_node(ParseNode.COMPARISON, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例11: FLRoot

def FLRoot(children):
    return ParseNode.construct_node(ParseNode.FL_ROOT, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例12: FLReference

def FLReference(children):
    return ParseNode.construct_node(ParseNode.FL_REFERENCE, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例13: FLNakedWorksheetReference

def FLNakedWorksheetReference(children):
    return ParseNode.construct_node(ParseNode.FL_NAKED_WORKSHEET_REFERENCE, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例14: LambDef

def LambDef(children):
    return ParseNode.construct_node(ParseNode.LAMBDEF, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py

示例15: ListFor

def ListFor(children):
    return ParseNode.construct_node(ParseNode.LIST_FOR, children)
開發者ID:bwhmather,項目名稱:dirigible-spreadsheet,代碼行數:2,代碼來源:parse_node_constructors.py


注:本文中的dirigible.sheet.parser.parse_node.ParseNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。