当前位置: 首页>>代码示例>>Python>>正文


Python ParseNode.register_node_type方法代码示例

本文整理汇总了Python中dirigible.sheet.parser.parse_node.ParseNode.register_node_type方法的典型用法代码示例。如果您正苦于以下问题:Python ParseNode.register_node_type方法的具体用法?Python ParseNode.register_node_type怎么用?Python ParseNode.register_node_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dirigible.sheet.parser.parse_node.ParseNode的用法示例。


在下文中一共展示了ParseNode.register_node_type方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: colIndex

# 需要导入模块: from dirigible.sheet.parser.parse_node import ParseNode [as 别名]
# 或者: from dirigible.sheet.parser.parse_node.ParseNode import register_node_type [as 别名]
    def colIndex(self):
        return column_name_to_index(self.plainColumnName)

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


    def offset(self, count, _, moveAbsolute=False):
        if not moveAbsolute and self.isAbsolute:
            return
        newName = column_index_to_name(self.colIndex + count)
        if newName:
            self.plainColumnName = newName
        else:
            self.localReference = '#Invalid!' + self.whitespace

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

    localReference = property(__getLocalReference, __setLocalReference)


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

ParseNode.register_node_type(ParseNode.FL_COLUMN_REFERENCE, FLColumnReferenceParseNode)
开发者ID:bwhmather,项目名称:dirigible-spreadsheet,代码行数:32,代码来源:fl_column_reference_parse_node.py

示例2: FLCellRangeParseNode

# 需要导入模块: from dirigible.sheet.parser.parse_node import ParseNode [as 别名]
# 或者: from dirigible.sheet.parser.parse_node.ParseNode import register_node_type [as 别名]
#

from dirigible.sheet.parser.parse_node import ParseNode

class FLCellRangeParseNode(ParseNode):

    def __init__(self, children):
        assert len(children) == 3
        ParseNode.__init__(self, ParseNode.FL_CELL_RANGE, children)

    def __get_first_cell_reference(self):
        return self.children[0]
    def __set_first_cell_reference(self, cellRef):
        self.children[0] = cellRef

    first_cell_reference = property(__get_first_cell_reference, __set_first_cell_reference)

    def __get_second_cell_reference(self):
        return self.children[2]

    def __set_second_cell_reference(self, cellRef):
        self.children[2] = cellRef

    second_cell_reference = property(__get_second_cell_reference, __set_second_cell_reference)

    @property
    def colon(self):
        return self.children[1]

ParseNode.register_node_type(ParseNode.FL_CELL_RANGE, FLCellRangeParseNode)
开发者ID:bwhmather,项目名称:dirigible-spreadsheet,代码行数:32,代码来源:fl_cell_range_parse_node.py

示例3: property

# 需要导入模块: from dirigible.sheet.parser.parse_node import ParseNode [as 别名]
# 或者: from dirigible.sheet.parser.parse_node.ParseNode import register_node_type [as 别名]
    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,代码行数:31,代码来源:fl_cell_reference_parse_node.py

示例4: rowIndex

# 需要导入模块: from dirigible.sheet.parser.parse_node import ParseNode [as 别名]
# 或者: from dirigible.sheet.parser.parse_node.ParseNode import register_node_type [as 别名]
    @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,代码行数:30,代码来源:fl_row_reference_parse_node.py

示例5: Copyright

# 需要导入模块: from dirigible.sheet.parser.parse_node import ParseNode [as 别名]
# 或者: from dirigible.sheet.parser.parse_node.ParseNode import register_node_type [as 别名]
# Copyright (c) 2005-2009 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#

from dirigible.sheet.parser.parse_node import ParseNode
from dirigible.sheet.parser.fl_reference_parse_node import FLReferenceParseNode


class FLNamedColumnReferenceParseNode(FLReferenceParseNode):

    def __init__(self, children):
        FLReferenceParseNode.__init__(self, ParseNode.FL_NAMED_COLUMN_REFERENCE, children)


    @property
    def header(self):
        return self.children[-1].rstrip().replace("##", "#")[1:-2]


ParseNode.register_node_type(ParseNode.FL_NAMED_COLUMN_REFERENCE, FLNamedColumnReferenceParseNode)
开发者ID:bwhmather,项目名称:dirigible-spreadsheet,代码行数:22,代码来源:fl_named_column_reference_parse_node.py

示例6: Copyright

# 需要导入模块: from dirigible.sheet.parser.parse_node import ParseNode [as 别名]
# 或者: from dirigible.sheet.parser.parse_node.ParseNode import register_node_type [as 别名]
# Copyright (c) 2005-2009 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#

from dirigible.sheet.parser.parse_node import ParseNode
from dirigible.sheet.parser.fl_reference_parse_node import FLReferenceParseNode


class FLNamedRowReferenceParseNode(FLReferenceParseNode):

    def __init__(self, children):
        FLReferenceParseNode.__init__(self, ParseNode.FL_NAMED_ROW_REFERENCE, children)


    @property
    def header(self):
        return self.children[-1].rstrip().replace("##", "#")[2:-1]


ParseNode.register_node_type(ParseNode.FL_NAMED_ROW_REFERENCE, FLNamedRowReferenceParseNode)
开发者ID:bwhmather,项目名称:dirigible-spreadsheet,代码行数:22,代码来源:fl_named_row_reference_parse_node.py


注:本文中的dirigible.sheet.parser.parse_node.ParseNode.register_node_type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。