本文整理汇总了Python中GNUScreen.require_dumpscreen_window方法的典型用法代码示例。如果您正苦于以下问题:Python GNUScreen.require_dumpscreen_window方法的具体用法?Python GNUScreen.require_dumpscreen_window怎么用?Python GNUScreen.require_dumpscreen_window使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GNUScreen
的用法示例。
在下文中一共展示了GNUScreen.require_dumpscreen_window方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save
# 需要导入模块: import GNUScreen [as 别名]
# 或者: from GNUScreen import require_dumpscreen_window [as 别名]
def save(self):
(self.homewindow, title) = self.get_number_and_title()
out("\nCreating directories:")
if not self.__setup_savedir(self.basedir, self.savedir):
return 1
sc.require_dumpscreen_window(self.pid, True)
if self.enable_layout:
out("\nSaving layouts:")
self.__save_layouts()
out("\nSaving windows:")
self.__save_screen()
out("\nCleaning up scrollbacks.")
self.__scrollback_clean()
if self.__vim_files:
self.__wait_vim()
return 0
示例2: __move_all_windows
# 需要导入模块: import GNUScreen [as 别名]
# 或者: from GNUScreen import require_dumpscreen_window [as 别名]
def __move_all_windows(self, shift, group, kill=False):
homewindow = int(self.homewindow)
# create a wrap group for existing windows
if not self.bNoGroupWrap:
self.wrap_group_id = self.screen('-t "%s" //group' % ("%s_%s" % (group, self.__unique_ident)))
self.group(False, self.none_group, self.wrap_group_id)
# move windows by shift and put them in a wrap group
# for cwin,cgroupid,ctype,ctty in sc.gen_all_windows_fast(self.pid):
for (
cwin,
cgroupid,
cgroup,
ctty,
ctype,
ctypestr,
ctitle,
cfilter,
cscroll,
ctime,
cmdargs,
) in sc.gen_all_windows_full(self.pid, sc.require_dumpscreen_window(self.pid, True)):
iwin = int(cwin)
if iwin == homewindow:
homewindow = iwin + shift
self.homewindow = str(homewindow)
if not self.bNoGroupWrap and cgroup == self.none_group:
self.select(self.wrap_group_id)
self.group(False, group, str(cwin))
command = "%s -p %s -X number +%d" % (self.sc, cwin, shift)
if not self.bNoGroupWrap and str(cwin) == str(self.wrap_group_id):
out("Moving wrap group %s to %d" % (cwin, iwin + shift))
self.wrap_group_id = str(iwin + shift)
else:
out("Moving window %s to %d" % (cwin, iwin + shift))
os.system(command)
self.select("%d" % homewindow)