=== removed file 'nointeractive.tmux.conf' --- nointeractive.tmux.conf 2013-04-29 00:25:23 +0000 +++ nointeractive.tmux.conf 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -set -g default-terminal screen-256color -set -g prefix M-C-@ -set -g bell-action any -set -g status off === modified file 'tst.py' --- tst.py 2013-04-29 00:25:23 +0000 +++ tst.py 2013-04-27 00:46:35 +0000 @@ -19,13 +19,8 @@ class TST(object): - """ - Vertical tree-style-tabs alike for tmux. - """ - def __init__(self, sockname='tst'): self.sockname = sockname - self._redraw_pending = False self.head = [urwid.Text('TST'), urwid.Divider()] self.body = urwid.SimpleFocusListWalker(self.head) @@ -40,23 +35,14 @@ ) def call_tmux(self, *args): - """ - Run tmux executable with socket option set. - """ return getProcessOutput('/usr/bin/tmux', ('-L', self.sockname) + args) def get_panes(self): - """ - Call tmux to get list of panes. - """ return self.call_tmux(*'list-panes -a -F'.split() + ['|'.join(( '#{%s}' % i for i in pane_format ))]).addCallback(self.got_panes) def got_panes(self, s): - """ - Process list of panes and update TST accordingly. - """ buttons = [] for line in s.split('\n'): if not line: @@ -67,41 +53,19 @@ d['window_index']) buttons.append(urwid.AttrMap(b, None, focus_map='reversed')) self.body[2:] = buttons - # self.mainloop.draw_screen() - self.redraw() - - def redraw(self): - """ - Schedule window redraw at closest idle time. - """ - if self._redraw_pending: - return - self._redraw_pending = True - self.reactor.callLater(0, self._do_redraw) - - def _do_redraw(self): - self._redraw_pending = False self.mainloop.draw_screen() def clicked(self, button, window): self.call_tmux('select-window', '-t', window) - def run(self, reactor=None): - """ - Run the TST application. - """ - - if reactor is None: - from twisted.internet import reactor - self.reactor = reactor - + def run(self): self.get_panes() self.paneloop = LoopingCall(self.get_panes) self.paneloop.start(1) self.mainloop = urwid.MainLoop( self.main, palette=[('reversed', 'standout', '')], - event_loop=urwid.TwistedEventLoop(reactor) + event_loop=urwid.TwistedEventLoop() ) self.mainloop.run()