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


Python visitorUtil.visitGeneric函数代码示例

本文整理汇总了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]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:8,代码来源:operator.py

示例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]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:7,代码来源:control.py

示例3: visitSety

def visitSety(blockcontext):
    y = visitGeneric(blockcontext, "Y")
    return ["ypos:", y]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:3,代码来源:motion.py

示例4: visitSetx

def visitSetx(blockcontext):
    x = visitGeneric(blockcontext, "X")
    return ["xpos:", x]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:3,代码来源:motion.py

示例5: visitChangexby

def visitChangexby(blockcontext):
    x = visitGeneric(blockcontext, "DX")
    return ["changeXposBy:", x]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:3,代码来源:motion.py

示例6: visitPointindirection

def visitPointindirection(blockcontext):
    direction = visitGeneric(blockcontext, "DIRECTION")
    return ["heading:", direction]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:3,代码来源:motion.py

示例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?
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:5,代码来源:motion.py

示例8: visitGoto

def visitGoto(blockcontext):
    to = visitGeneric(blockcontext, "TO")
    return ["gotoSpriteOrMouse:", to]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:3,代码来源:motion.py

示例9: visitSeteffectto

def visitSeteffectto(blockcontext):
    block = blockcontext.block
    effect = block.fields["EFFECT"][0]
    value = visitGeneric(blockcontext, "VALUE")
    return ["setGraphicEffect:to:", effect, value]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:5,代码来源:looks.py

示例10: visitSayforsecs

def visitSayforsecs(blockcontext):
    message = visitGeneric(blockcontext, "MESSAGE")
    duration = visitGeneric(blockcontext, "SECS")
    return ["say:duration:elapsed:from:", message, duration]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:4,代码来源:looks.py

示例11: visitChangeeffectby

def visitChangeeffectby(blockcontext):
    block = blockcontext.block
    effect = block.fields["EFFECT"][0]
    change = visitGeneric(blockcontext, "CHANGE")
    return ["changeGraphicEffect:by:", effect, change]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:5,代码来源:looks.py

示例12: visitSetsizeto

def visitSetsizeto(blockcontext):
    size = visitGeneric(blockcontext, "SIZE")
    return ["setSizeTo:", size]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:3,代码来源:looks.py

示例13: visitChangesizeby

def visitChangesizeby(blockcontext):
    size = visitGeneric(blockcontext, "CHANGE")
    return ["changeSizeBy:", size]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:3,代码来源:looks.py

示例14: visitSwitchbackdropto

def visitSwitchbackdropto(blockcontext):
    backdrop = visitGeneric(blockcontext, "BACKDROP")
    return ["startScene", backdrop]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:3,代码来源:looks.py

示例15: visitSwitchcostumeto

def visitSwitchcostumeto(blockcontext):
    costume = visitGeneric(blockcontext, "COSTUME")
    return ["lookLike:", costume]
开发者ID:Catrobat,项目名称:ScratchToCatrobat,代码行数:3,代码来源:looks.py


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