From 9fb987c29b60414588226eac24d307bfe8b7a938 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 5 Aug 2012 01:07:32 +0200 Subject: core.environment: s/fm.env.termsize/fm.ui.termsize --- ranger/core/actions.py | 4 ++-- ranger/core/environment.py | 1 - ranger/gui/displayable.py | 2 +- ranger/gui/ui.py | 5 +++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 0d76f2e8..31098738 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -546,7 +546,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): cwd = self.env.cwd direction = Direction(dirarg) pos, selected = direction.select(lst=cwd.files, current=cwd.pointer, - pagesize=self.env.termsize[0]) + pagesize=self.ui.termsize[0]) cwd.pointer = pos cwd.correct_pointer() for item in selected: @@ -967,7 +967,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): offset = 1 pos, selected = direction.select( override=narg, lst=cwd.files, current=cwd.pointer, - pagesize=self.env.termsize[0], offset=offset) + pagesize=self.ui.termsize[0], offset=offset) cwd.pointer = pos cwd.correct_pointer() if mode == 'set': diff --git a/ranger/core/environment.py b/ranger/core/environment.py index 171f716b..153e4f55 100644 --- a/ranger/core/environment.py +++ b/ranger/core/environment.py @@ -21,7 +21,6 @@ class Environment(SettingsAware, SignalDispatcher): copy = None cmd = None cut = None - termsize = None history = None directories = None last_search = None diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py index 8888d8bf..a70dd2ff 100644 --- a/ranger/gui/displayable.py +++ b/ranger/gui/displayable.py @@ -142,7 +142,7 @@ class Displayable(EnvironmentAware, FileManagerAware, CursesShortcuts): """Resize the widget""" do_move = True try: - maxy, maxx = self.env.termsize + maxy, maxx = self.fm.ui.termsize except TypeError: pass else: diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index b0d3edc6..a0aa800f 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -57,6 +57,7 @@ class UI(DisplayableContainer): os.environ['TERM'] = 'linux' self.win = curses.initscr() self.env.keymaps.use_keymap('browser') + self.termsize = self.win.getmaxyx() DisplayableContainer.__init__(self, None) @@ -259,8 +260,8 @@ class UI(DisplayableContainer): def update_size(self): """resize all widgets""" - self.env.termsize = self.win.getmaxyx() - y, x = self.env.termsize + self.termsize = self.win.getmaxyx() + y, x = self.termsize self.browser.resize(1, 0, y - 2, x) self.taskview.resize(1, 0, y - 2, x) -- cgit 1.4.1-2-gfad0