本文整理汇总了Python中visitorUtil.visitGeneric函数的典型用法代码示例。如果您正苦于以下问题:Python visitGeneric函数的具体用法?Python visitGeneric怎么用?Python visitGeneric使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了visitGeneric函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: visitOr
def visitOr(blockcontext):
operand1 = visitGeneric(blockcontext, "OPERAND1")
if operand1 is None:
operand1 = False
operand2 = visitGeneric(blockcontext, "OPERAND2")
if operand2 is None:
operand2 = False
return ["|", operand1, operand2]
示例2: visitRepeat
def visitRepeat(blockcontext):
block = blockcontext.block
times = visitGeneric(blockcontext, "TIMES")
if times == []:
times = block.inputs["TIMES"][1][1]
substack = visitSubstack(blockcontext, "SUBSTACK")
return ["doRepeat", times, substack]
示例3: visitSety
def visitSety(blockcontext):
y = visitGeneric(blockcontext, "Y")
return ["ypos:", y]
示例4: visitSetx
def visitSetx(blockcontext):
x = visitGeneric(blockcontext, "X")
return ["xpos:", x]
示例5: visitChangexby
def visitChangexby(blockcontext):
x = visitGeneric(blockcontext, "DX")
return ["changeXposBy:", x]
示例6: visitPointindirection
def visitPointindirection(blockcontext):
direction = visitGeneric(blockcontext, "DIRECTION")
return ["heading:", direction]
示例7: visitGlideto
def visitGlideto(blockcontext):
secs = visitGeneric(blockcontext, "SECS")
to = visitGeneric(blockcontext, "TO")
log.warn("[Scratch3] block {} ({}) possibly not available in Scratch2".format(blockcontext.block.opcode, blockcontext.block.name))
return ["glideTo:", secs, to] #TODO: not in scratch2?
示例8: visitGoto
def visitGoto(blockcontext):
to = visitGeneric(blockcontext, "TO")
return ["gotoSpriteOrMouse:", to]
示例9: visitSeteffectto
def visitSeteffectto(blockcontext):
block = blockcontext.block
effect = block.fields["EFFECT"][0]
value = visitGeneric(blockcontext, "VALUE")
return ["setGraphicEffect:to:", effect, value]
示例10: visitSayforsecs
def visitSayforsecs(blockcontext):
message = visitGeneric(blockcontext, "MESSAGE")
duration = visitGeneric(blockcontext, "SECS")
return ["say:duration:elapsed:from:", message, duration]
示例11: visitChangeeffectby
def visitChangeeffectby(blockcontext):
block = blockcontext.block
effect = block.fields["EFFECT"][0]
change = visitGeneric(blockcontext, "CHANGE")
return ["changeGraphicEffect:by:", effect, change]
示例12: visitSetsizeto
def visitSetsizeto(blockcontext):
size = visitGeneric(blockcontext, "SIZE")
return ["setSizeTo:", size]
示例13: visitChangesizeby
def visitChangesizeby(blockcontext):
size = visitGeneric(blockcontext, "CHANGE")
return ["changeSizeBy:", size]
示例14: visitSwitchbackdropto
def visitSwitchbackdropto(blockcontext):
backdrop = visitGeneric(blockcontext, "BACKDROP")
return ["startScene", backdrop]
示例15: visitSwitchcostumeto
def visitSwitchcostumeto(blockcontext):
costume = visitGeneric(blockcontext, "COSTUME")
return ["lookLike:", costume]