本文整理匯總了Python中GNUScreen.find_new_windows方法的典型用法代碼示例。如果您正苦於以下問題:Python GNUScreen.find_new_windows方法的具體用法?Python GNUScreen.find_new_windows怎麽用?Python GNUScreen.find_new_windows使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GNUScreen
的用法示例。
在下文中一共展示了GNUScreen.find_new_windows方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: out
# 需要導入模塊: import GNUScreen [as 別名]
# 或者: from GNUScreen import find_new_windows [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))
示例2: open
# 需要導入模塊: import GNUScreen [as 別名]
# 或者: from GNUScreen import find_new_windows [as 別名]
if __name__ == "__main__":
sys.stdout = open(logfile, "w")
sys.stderr = sys.stdout
session = sys.argv[1]
win = (
subprocess.Popen("screen -S %s -Q @number" % (session), shell=True, stdout=subprocess.PIPE)
.communicate()[0]
.strip()
.split(" ", 1)[0]
)
print("win before get_regions_count: " + win)
# regions_c=get_regions_count_no_layout(session,)
regions_c = get_regions_count(session, dumpfile)
ident = subprogram + " " + inputfile
global win_history
win_history = get_win_history(session, regions_c)
w1 = sc.parse_windows(sc.get_windows(session))[0]
start_subprograms(session, subprogram, inputfile, regions_c, 5)
w2 = sc.parse_windows(sc.get_windows(session))[0]
print(w1)
print(w2)
wins = sc.find_new_windows(w1, w2)
print(wins)
signal.signal(signal.SIGUSR1, handler)
time.sleep(4)
cleanup()