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


Python u.load函数代码示例

本文整理汇总了Python中u.load函数的典型用法代码示例。如果您正苦于以下问题:Python load函数的具体用法?Python load怎么用?Python load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: testBackJoinElements

def testBackJoinElements():
    sp = u.load()
    sp.cmd("moveDown")
    sp.cmd("deleteBackward")
    assert (sp.line == 0) and (sp.column == 23)
    assert sp.lines[0].text == "ext. stonehenge - nightA blizzard rages."\
           " Snow is everywhere"
开发者ID:millingjon,项目名称:scrupulous,代码行数:7,代码来源:delete.py

示例2: testMoveUp

def testMoveUp():
    sp = u.load()
    sp.cmd("moveUp")
    assert (sp.line == 0) and (sp.column == 0)
    sp.cmd("moveDown")
    sp.cmd("moveLineEnd")
    sp.cmd("moveUp")
    assert (sp.line == 0) and (sp.column == 23)
开发者ID:4thguy,项目名称:trelby,代码行数:8,代码来源:movement.py

示例3: testBackLbForced

def testBackLbForced():
    sp = u.load()

    sp.gotoPos(34, 0)
    assert sp.lines[33].lb == scr.LB_FORCED
    sp.cmd("deleteBackward")
    assert (sp.line == 33) and (sp.column == 6)
    assert sp.lines[33].text == "brightyellow package at their feet."
    assert sp.lines[33].lb == scr.LB_LAST
开发者ID:millingjon,项目名称:scrupulous,代码行数:9,代码来源:delete.py

示例4: testMoveLeft

def testMoveLeft():
    sp = u.load()
    sp.cmd("moveLeft")
    assert (sp.line == 0) and (sp.column == 0)
    sp.cmd("moveDown")
    sp.cmd("moveLeft")
    assert (sp.line == 0) and (sp.column == 23)
    sp.cmd("moveLineStart")
    assert sp.column == 0
开发者ID:4thguy,项目名称:trelby,代码行数:9,代码来源:movement.py

示例5: testBasic

def testBasic():
    sp = u.load()
    report = characterreport.CharacterReport(sp)
    data = report.generate()

    # try to catch cases where generate returns something other than a PDF
    # document
    assert len(data) > 200
    assert data[:8] == "%PDF-1.5"
开发者ID:G33kX,项目名称:trelby,代码行数:9,代码来源:t_characterreport.py

示例6: testBasic

def testBasic():
    sp = u.load()

    sp.cmd("setMark")
    sp.getSelectedAsCD(True)

    assert sp.lines[0].lb == scr.LB_LAST
    assert sp.lines[0].lt == scr.SCENE
    assert sp.lines[0].text == "xt. stonehenge - night"
开发者ID:4thguy,项目名称:trelby,代码行数:9,代码来源:cut.py

示例7: testBasic

def testBasic():
    sp = u.load()
    report = locationreport.LocationReport(scenereport.SceneReport(sp))
    data = report.generate()

    # try to catch cases where generate returns something other than a PDF
    # document
    assert len(data) > 200
    assert data[:8] == "%PDF-1.5"
开发者ID:4thguy,项目名称:trelby,代码行数:9,代码来源:t_locationreport.py

示例8: testMoveSceneDown

def testMoveSceneDown():
    sp = u.load()
    sp.cmd("moveSceneDown")
    assert (sp.line == 14) and (sp.column == 0)
    sp.cmd("moveDown")
    sp.cmd("moveSceneDown")
    assert (sp.line == 30) and (sp.column == 0)
    sp.cmd("moveEnd")
    sp.cmd("moveSceneDown")
    assert (sp.line == 158) and (sp.column == 0)
开发者ID:4thguy,项目名称:trelby,代码行数:10,代码来源:movement.py

示例9: testBackLbForcedTypeConvert

def testBackLbForcedTypeConvert():
    sp = u.load()

    sp.cmd("toTransition")
    sp.cmd("moveDown", count=3)
    sp.cmd("insertForcedLineBreak")
    sp.cmd("moveUp")
    sp.cmd("deleteBackward")

    sp._validate()
开发者ID:millingjon,项目名称:scrupulous,代码行数:10,代码来源:delete.py

示例10: testMoveRight

def testMoveRight():
    sp = u.load()
    sp.cmd("moveRight")
    assert sp.column == 1
    sp.cmd("moveLineEnd")
    sp.cmd("moveRight")
    assert (sp.line == 1) and (sp.column == 0)
    sp.cmd("moveEnd")
    sp.cmd("moveRight")
    assert (sp.line == 158) and (sp.column == 5)
开发者ID:4thguy,项目名称:trelby,代码行数:10,代码来源:movement.py

示例11: testNbspAtEOL

def testNbspAtEOL():
    sp = u.load()
    sp.cmd("moveDown", count = 3)
    sp.cmd("moveLineEnd")
    sp.cmd("addChar", char = chr(160))
    sp.cmd("addChar", char = "a")
    assert sp.lines[3].text.endswith("mind")
    assert sp.lines[4].text.startswith("would%sa" % chr(160))
    assert (sp.line == 4) and (sp.column == 7)
    assert sp.lines[3].lb == scr.LB_SPACE
    assert sp.lines[4].lb == scr.LB_LAST
开发者ID:4thguy,项目名称:trelby,代码行数:11,代码来源:addchar.py

示例12: testForcedLb

def testForcedLb():
    sp = u.load()

    sp.cmd("moveDown", count = 2)
    sp.cmd("insertForcedLineBreak")
    sp.cmd("moveUp", count = 2)
    sp.cmd("moveLineEnd")
    sp.cmd("setMark")
    sp.cmd("moveRight")
    sp.getSelectedAsCD(True)
    sp._validate()
开发者ID:4thguy,项目名称:trelby,代码行数:11,代码来源:cut.py

示例13: testMoveDown

def testMoveDown():
    sp = u.load()
    sp.cmd("moveDown")
    assert sp.line == 1
    sp.cmd("moveDown")
    sp.cmd("moveDown")
    sp.cmd("moveLineEnd")
    sp.cmd("moveDown")
    assert (sp.line == 4) and (sp.column == 31)
    sp.cmd("moveEnd")
    sp.cmd("moveDown")
    assert sp.line == 158
开发者ID:4thguy,项目名称:trelby,代码行数:12,代码来源:movement.py

示例14: testLastDelete

def testLastDelete():
    sp = u.load()

    sp.cmd("moveEnd")
    sp.cmd("setMark")
    sp.cmd("moveUp", count = 4)
    sp.cmd("moveLineStart")

    # we used to have a bug where if we deleted e.g. the last two lines of
    # the script, and that element was longer, we didn't mark the
    # third-last line as LB_LAST, and then it crashed in rewrapPara.
    sp.getSelectedAsCD(True)
开发者ID:4thguy,项目名称:trelby,代码行数:12,代码来源:cut.py

示例15: run

    def run(self, sp):
        if self.name == "NEW":
            return u.new()
        elif self.name == "LOAD":
            return u.load()

        if self.args:
            sp.cmd(self.name, chr(self.args[0]))
        else:
            sp.cmd(self.name)

        return sp
开发者ID:cowmix,项目名称:trelby,代码行数:12,代码来源:t_random.py


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