diff options
author | nfnty <git@nfnty.se> | 2017-01-25 19:07:05 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2017-01-25 19:07:05 +0100 |
commit | 2d8affddf55ab352afce58b846da45b90d715b9b (patch) | |
tree | c71d975a760cca02754efe678b84a5fd29968a77 /ranger | |
parent | 3021188bcd12095c72e505e7d57d01c0dbf44a35 (diff) | |
download | ranger-2d8affddf55ab352afce58b846da45b90d715b9b.tar.gz |
gui: Replace `_curses` with `curses`
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/curses_shortcuts.py | 7 | ||||
-rw-r--r-- | ranger/gui/ui.py | 5 | ||||
-rw-r--r-- | ranger/gui/widgets/view_miller.py | 5 |
3 files changed, 7 insertions, 10 deletions
diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py index 648292c5..3d2b7d18 100644 --- a/ranger/gui/curses_shortcuts.py +++ b/ranger/gui/curses_shortcuts.py @@ -5,7 +5,6 @@ from __future__ import (absolute_import, division, print_function) import sys import curses -import _curses from ranger.gui.color import get_color from ranger.core.shared import SettingsAware @@ -72,7 +71,7 @@ class CursesShortcuts(SettingsAware): attr = self.settings.colorscheme.get_attr(*keys) try: self.win.attrset(attr) - except _curses.error: + except curses.error: pass def color_at(self, y, x, wid, *keys): @@ -80,13 +79,13 @@ class CursesShortcuts(SettingsAware): attr = self.settings.colorscheme.get_attr(*keys) try: self.win.chgat(y, x, wid, attr) - except _curses.error: + except curses.error: pass def set_fg_bg_attr(self, fg, bg, attr): try: self.win.attrset(curses.color_pair(get_color(fg, bg)) | attr) - except _curses.error: + except curses.error: pass def color_reset(self): diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 20e01536..cbdcabf0 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -7,7 +7,6 @@ import os import sys import threading import curses -import _curses from ranger.ext.keybinding_parser import KeyBuffer, KeyMaps, ALT_KEY from ranger.ext.lazy_property import lazy_property @@ -73,7 +72,7 @@ class UI( # pylint: disable=too-many-instance-attributes,too-many-public-method os.environ['ESCDELAY'] = '25' # don't know a cleaner way try: self.win = curses.initscr() - except _curses.error as ex: + except curses.error as ex: if ex.args[0] == "setupterm: could not find terminal": os.environ['TERM'] = 'linux' self.win = curses.initscr() @@ -161,7 +160,7 @@ class UI( # pylint: disable=too-many-instance-attributes,too-many-public-method """Handles mouse input""" try: event = MouseEvent(curses.getmouse()) - except _curses.error: + except curses.error: return if not self.console.visible: DisplayableContainer.click(self, event) diff --git a/ranger/gui/widgets/view_miller.py b/ranger/gui/widgets/view_miller.py index e79ade79..1f08e1af 100644 --- a/ranger/gui/widgets/view_miller.py +++ b/ranger/gui/widgets/view_miller.py @@ -6,7 +6,6 @@ from __future__ import (absolute_import, division, print_function) import curses -import _curses from ranger.container import settings from ranger.gui.widgets.view_base import ViewBase @@ -136,7 +135,7 @@ class ViewMiller(ViewBase): # pylint: disable=too-many-ancestors,too-many-insta win.hline(self.hei - 1, left_start, curses.ACS_HLINE, right_end - left_start) win.vline(1, left_start, curses.ACS_VLINE, self.hei - 2) # pylint: enable=no-member - except _curses.error: + except curses.error: pass # Draw the vertical lines in the middle @@ -164,7 +163,7 @@ class ViewMiller(ViewBase): # pylint: disable=too-many-ancestors,too-many-insta # pylint: disable=no-member win.vline(1, right_end, curses.ACS_VLINE, self.hei - 2) # pylint: enable=no-member - except _curses.error: + except curses.error: pass # pylint: disable=no-member |