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


Python GNUScreen.move方法代码示例

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


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

示例1: out

# 需要导入模块: import GNUScreen [as 别名]
# 或者: from GNUScreen import move [as 别名]
# pids=sc.sort_by_ppid(pids)
thepid = pids[len(pids) - 1]
thedir = sc.get_pid_info(thepid)[0]

out(thedir, bPrint)

os.chdir(thedir)

# command='screen %s -X screen' % (session_arg)
command = "screen"
if len(sys.argv) > 2:
    command += ' -t "%s"' % (" ".join(["%s" % v for v in sys.argv[2:]]))
else:
    command += ' -t "%s"' % (thedir)


for arg in sys.argv[2:]:
    command += " " + arg
out(command, bPrint)
os.system(command)


windows_new = sc.parse_windows(sc.get_windows(session))[0]
out(str(windows_new), bPrint)
windows_diff = sc.find_new_windows(windows_old, windows_new)
target = windows_diff[0]
out("%s to %s" % (target, cwin), bPrint)
moveto = int(cwin) + 1
sc.move(int(target), moveto, True, session)
# os.system('screen %s -p %s -X title blah'%(session,endpos))
开发者ID:testacc,项目名称:screen-session,代码行数:32,代码来源:screen-in-dir.py

示例2: int

# 需要导入模块: import GNUScreen [as 别名]
# 或者: from GNUScreen import move [as 别名]
command += primer
command += [thedir]

try:
    program = (sys.argv)[ARGSNUM]
    command += (sys.argv)[ARGSNUM:]
except:
    command += [os.getenv('SHELL')]
#print command
#os.spawnvp(os.P_WAIT, SCREEN , command)
f = os.popen2(command)[1]
nwin = f.readline().split(':')[1].strip()
f.close()
nwin = '-'

if tgroup != '-1':
    # '-' may be used instead of nwin
    os.spawnv(os.P_WAIT, SCREEN , ['screen', '-S', session, '-p', nwin, '-X', 'group', tgroup])

if nwin != '-1':
    if number != '-1':
        sc.move(int(nwin), int(number), True, session)
        print(number)
    elif bRenumber:
        targ_num = int(cwin) + 1
        sc.move(int(nwin), targ_num, True, session)
        print(targ_num)
else:
    print(nwin)

开发者ID:chronidev,项目名称:screen-session,代码行数:31,代码来源:new-window.py


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