当前位置: 首页>>代码示例>>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;未经允许,请勿转载。