本文整理汇总了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",
)
示例2: __init__
def __init__(self, children):
assert len(children) == 3
ParseNode.__init__(self, ParseNode.FL_CELL_RANGE, children)
示例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)
示例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)
示例5: ListMaker
def ListMaker(children):
return ParseNode.construct_node(ParseNode.LIST_MAKER, children)
示例6: ListIf
def ListIf(children):
return ParseNode.construct_node(ParseNode.LIST_IF, children)
示例7: Expr
def Expr(children):
return ParseNode.construct_node(ParseNode.EXPR, children)
示例8: DictMaker
def DictMaker(children):
return ParseNode.construct_node(ParseNode.DICT_MAKER, children)
示例9: CompOperator
def CompOperator(children):
return ParseNode.construct_node(ParseNode.COMP_OPERATOR, children)
示例10: Comparison
def Comparison(children):
return ParseNode.construct_node(ParseNode.COMPARISON, children)
示例11: FLRoot
def FLRoot(children):
return ParseNode.construct_node(ParseNode.FL_ROOT, children)
示例12: FLReference
def FLReference(children):
return ParseNode.construct_node(ParseNode.FL_REFERENCE, children)
示例13: FLNakedWorksheetReference
def FLNakedWorksheetReference(children):
return ParseNode.construct_node(ParseNode.FL_NAKED_WORKSHEET_REFERENCE, children)
示例14: LambDef
def LambDef(children):
return ParseNode.construct_node(ParseNode.LAMBDEF, children)
示例15: ListFor
def ListFor(children):
return ParseNode.construct_node(ParseNode.LIST_FOR, children)