本文整理匯總了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)