コード例 #1
0
ファイル: find_file.py プロジェクト: chronidev/screen-session
#
#    Copyright (C) 2010-2011 Artur Skonecki http://github.com/skoneka
#
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
import tools

session = (sys.argv)[1]
files = (sys.argv)[2:]

pids = tools.find_files_in_pids(files)
try:
    pids = map(int, pids)
    for (win, title) in tools.find_pids_in_windows(session, tools.require_dumpscreen_window(session,
            False), pids):
        print "%s %s" % (win, title)
except:
    pass
コード例 #2
0
# -*- coding: utf-8 -*-
#
#    kill-group.py : recursively kill a group and all windows inside
#
#    Copyright (C) 2010-2011 Artur Skonecki http://github.com/skoneka
#
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
import tools
import util

session = (sys.argv)[1]

windows = util.expand_numbers_list((sys.argv)[2:])

tools.kill_group(session, tools.require_dumpscreen_window(session, False),
                 windows)
tools.cleanup()
コード例 #3
0
ファイル: kill-zombie.py プロジェクト: rlabok/screen-session
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#    kill-zombie.py : kill all zombie windows in the session
#
#    Copyright (C) 2010-2011 Artur Skonecki http://github.com/skoneka
#
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
import tools
import util

session = (sys.argv)[1]

windows = util.expand_numbers_list((sys.argv)[2:])

tools.kill_zombie(session, tools.require_dumpscreen_window(session, False), windows)
tools.cleanup()
コード例 #4
0
#    subwindows.py : recursively print windows contained in a group
#
#    Copyright (C) 2010-2011 Artur Skonecki http://github.com/skoneka
#
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
import tools
import util

session = (sys.argv)[1]

windows = util.expand_numbers_list((sys.argv)[2:])

(groups, subwindows) = tools.subwindows(
    session, tools.require_dumpscreen_window(session, False), windows)
print 'groups:  %s' % (" ").join(["%s" % v for v in groups])
print 'windows: %s' % (" ").join(["%s" % v for v in subwindows])
tools.cleanup()
コード例 #5
0
ファイル: dump.py プロジェクト: stevefoga/screen-session
import sys
import GNUScreen as sc
from ScreenSaver import ScreenSaver
import tools
import util

if __name__ == '__main__':
    session = (sys.argv)[1]
    showpid = (sys.argv)[2]
    reverse = (sys.argv)[3]
    sort = (sys.argv)[4]
    windows = util.expand_numbers_list((sys.argv)[5:])

    if showpid == '0':
        showpid = False
    else:
        showpid = True
    if reverse == '0':
        reverse = True
    else:
        reverse = False
    if sort == '0':
        sort = False
    else:
        sort = True
    ss = ScreenSaver(session)
    tools.dump(ss, tools.require_dumpscreen_window(session, True), showpid,
               reverse, sort, windows)
    tools.cleanup()
コード例 #6
0
ファイル: dump.py プロジェクト: chronidev/screen-session
import sys
import GNUScreen as sc
from ScreenSaver import ScreenSaver
import tools
import util 

if __name__ == '__main__':
    session = (sys.argv)[1]
    showpid = (sys.argv)[2]
    reverse = (sys.argv)[3]
    sort = (sys.argv)[4]
    windows = util.expand_numbers_list((sys.argv)[5:])

    if showpid == '0':
        showpid = False
    else:
        showpid = True
    if reverse == '0':
        reverse = True
    else:
        reverse = False
    if sort == '0':
        sort = False
    else:
        sort = True
    ss = ScreenSaver(session)
    tools.dump(ss, tools.require_dumpscreen_window(session, True),
               showpid, reverse, sort, windows)
    tools.cleanup()

コード例 #7
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#    renumber.py : renumber windows to fill the gaps
#
#    Copyright (C) 2010-2011 Artur Skonecki http://github.com/skoneka
#
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import sys
import tools
session = (sys.argv)[1]

tools.renumber(session, tools.require_dumpscreen_window(session, False))
tools.cleanup()
コード例 #8
0
ファイル: sort.py プロジェクト: stevefoga/screen-session
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#    sort.py :  sort windows by title; currently broken, it should be rewritten
#               with support for selecting groups through tools.subwindows()
#
#    Copyright (C) 2010-2011 Artur Skonecki http://github.com/skoneka
#
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import os
import sys
import tools
session = (sys.argv)[1]
tools.sort(session, tools.require_dumpscreen_window(session, False))
tools.cleanup()
コード例 #9
0
# -*- coding: utf-8 -*-
#
#    kill-zombie.py : kill all zombie windows in the session
#
#    Copyright (C) 2010-2011 Artur Skonecki http://github.com/skoneka
#
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import sys
import tools
import util

session = (sys.argv)[1]

windows = util.expand_numbers_list((sys.argv)[2:])

tools.kill_zombie(session, tools.require_dumpscreen_window(session, False),
                  windows)
tools.cleanup()