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


Python GetCursorPosition.x方法代码示例

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


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

示例1: test_HPA_DefaultParams

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
  def test_HPA_DefaultParams(self):
    """With no params, HPA moves to 1st column."""
    esccmd.HPA(6)

    position = GetCursorPosition()
    AssertEQ(position.x(), 6)

    esccmd.HPA()

    position = GetCursorPosition()
    AssertEQ(position.x(), 1)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:13,代码来源:hpa.py

示例2: test_HVP_ColumnOnly

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
  def test_HVP_ColumnOnly(self):
    """Default row is 1."""
    esccmd.HVP(Point(6, 3))

    position = GetCursorPosition()
    AssertEQ(position.x(), 6)
    AssertEQ(position.y(), 3)

    esccmd.HVP(col=2)

    position = GetCursorPosition()
    AssertEQ(position.x(), 2)
    AssertEQ(position.y(), 1)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:15,代码来源:hvp.py

示例3: test_CUP_RowOnly

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
  def test_CUP_RowOnly(self):
    """Default column is 1."""
    esccmd.CUP(Point(6, 3))

    position = GetCursorPosition()
    AssertEQ(position.x(), 6)
    AssertEQ(position.y(), 3)

    esccmd.CUP(row=2)

    position = GetCursorPosition()
    AssertEQ(position.x(), 1)
    AssertEQ(position.y(), 2)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:15,代码来源:cup.py

示例4: test_HVP_DefaultParams

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
  def test_HVP_DefaultParams(self):
    """With no params, HVP moves to 1,1."""
    esccmd.HVP(Point(6, 3))

    position = GetCursorPosition()
    AssertEQ(position.x(), 6)
    AssertEQ(position.y(), 3)

    esccmd.HVP()

    position = GetCursorPosition()
    AssertEQ(position.x(), 1)
    AssertEQ(position.y(), 1)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:15,代码来源:hvp.py

示例5: test_HVP_ZeroIsTreatedAsOne

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_HVP_ZeroIsTreatedAsOne(self):
   """Zero args are treated as 1."""
   esccmd.HVP(Point(6, 3))
   esccmd.HVP(col=0, row=0)
   position = GetCursorPosition()
   AssertEQ(position.x(), 1)
   AssertEQ(position.y(), 1)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:hvp.py

示例6: test_RI_Basic

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_RI_Basic(self):
   """Reverse index moves the cursor up one line."""
   esccmd.CUP(Point(5, 3))
   esccmd.RI()
   position = GetCursorPosition()
   AssertEQ(position.x(), 5)
   AssertEQ(position.y(), 2)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:ri.py

示例7: test_VT_Basic

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_VT_Basic(self):
   """VT moves the cursor down one line."""
   esccmd.CUP(Point(5, 3))
   escio.Write(VT)
   position = GetCursorPosition()
   AssertEQ(position.x(), 5)
   AssertEQ(position.y(), 4)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:vt.py

示例8: test_NEL_Basic

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_NEL_Basic(self):
   """Next Line moves the cursor down one line and to the start of the next line."""
   esccmd.CUP(Point(5, 3))
   esccmd.NEL()
   position = GetCursorPosition()
   AssertEQ(position.x(), 1)
   AssertEQ(position.y(), 4)
开发者ID:DanDanHang,项目名称:iTerm2,代码行数:9,代码来源:nel.py

示例9: test_CPL_ExplicitParam

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_CPL_ExplicitParam(self):
   """CPL moves the cursor up by the passed-in number of lines."""
   esccmd.CUP(Point(6, 5))
   esccmd.CPL(2)
   position = GetCursorPosition()
   AssertEQ(position.x(), 1)
   AssertEQ(position.y(), 3)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:cpl.py

示例10: test_CHA_ZeroParam

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_CHA_ZeroParam(self):
   """CHA moves as far left as possible when given a zero parameter."""
   esccmd.CUP(Point(5, 3))
   esccmd.CHA(0)
   position = GetCursorPosition()
   AssertEQ(position.x(), 1)
   AssertEQ(position.y(), 3)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:cha.py

示例11: test_HPR_DefaultParams

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
  def test_HPR_DefaultParams(self):
    """With no params, HPR moves right by 1."""
    esccmd.CUP(Point(6, 1))
    esccmd.HPR()

    position = GetCursorPosition()
    AssertEQ(position.x(), 7)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:hpr.py

示例12: test_CHA_ExplicitParam

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_CHA_ExplicitParam(self):
   """CHA moves to specified column of active line."""
   esccmd.CUP(Point(5, 3))
   esccmd.CHA(10)
   position = GetCursorPosition()
   AssertEQ(position.x(), 10)
   AssertEQ(position.y(), 3)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:cha.py

示例13: test_CHA_DefaultParam

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_CHA_DefaultParam(self):
   """CHA moves to first column of active line by default."""
   esccmd.CUP(Point(5, 3))
   esccmd.CHA()
   position = GetCursorPosition()
   AssertEQ(position.x(), 1)
   AssertEQ(position.y(), 3)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:cha.py

示例14: test_CUB_DefaultParam

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_CUB_DefaultParam(self):
   """CUB moves the cursor left 1 with no parameter given."""
   esccmd.CUP(Point(5, 3))
   esccmd.CUB()
   position = GetCursorPosition()
   AssertEQ(position.x(), 4)
   AssertEQ(position.y(), 3)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:cub.py

示例15: test_IND_Basic

# 需要导入模块: from escutil import GetCursorPosition [as 别名]
# 或者: from escutil.GetCursorPosition import x [as 别名]
 def test_IND_Basic(self):
   """Index moves the cursor down one line."""
   esccmd.CUP(Point(5, 3))
   esccmd.IND()
   position = GetCursorPosition()
   AssertEQ(position.x(), 5)
   AssertEQ(position.y(), 4)
开发者ID:AndiDog,项目名称:iTerm2,代码行数:9,代码来源:ind.py


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