summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.pylintrc2
-rw-r--r--ranger/gui/widgets/view_base.py24
2 files changed, 6 insertions, 20 deletions
diff --git a/.pylintrc b/.pylintrc
index 2adabf2f..8e87a39d 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -11,4 +11,4 @@ max-line-length = 99
 disable=locally-disabled,locally-enabled,missing-docstring,duplicate-code,fixme,broad-except,cyclic-import,attribute-defined-outside-init,access-member-before-definition
 
 [TYPECHECK]
-ignored-classes=ranger.core.actions.Actions,ranger.gui.widgets.view_base.ViewBase,ranger.gui.curses_shortcuts.CursesShortcuts
+ignored-classes=ranger.core.actions.Actions,ranger.gui.curses_shortcuts.CursesShortcuts
diff --git a/ranger/gui/widgets/view_base.py b/ranger/gui/widgets/view_base.py
index 3ec01c72..b91c7e21 100644
--- a/ranger/gui/widgets/view_base.py
+++ b/ranger/gui/widgets/view_base.py
@@ -23,6 +23,10 @@ class ViewBase(Widget, DisplayableContainer):  # pylint: disable=too-many-instan
         self.fm.signal_bind('move', self.request_clear)
         self.old_draw_borders = self.settings.draw_borders
 
+        self.columns = None
+        self.main_column = None
+        self.pager = None
+
     def request_clear(self):
         self.need_clear = True
 
@@ -45,7 +49,7 @@ class ViewBase(Widget, DisplayableContainer):  # pylint: disable=too-many-instan
             self._draw_info(self.draw_info)
 
     def finalize(self):
-        if hasattr(self, 'pager') and self.pager.visible:
+        if self.pager is not None and self.pager.visible:
             try:
                 self.fm.ui.win.move(self.main_column.y, self.main_column.x)
             except Exception:
@@ -129,24 +133,6 @@ class ViewBase(Widget, DisplayableContainer):  # pylint: disable=too-many-instan
             self.addnstr(i, 0, string, self.wid)
             i += 1
 
-    def _collapse(self):
-        # Should the last column be cut off? (Because there is no preview)
-        if not self.settings.collapse_preview or not self.preview \
-                or not self.stretch_ratios:
-            return False
-        result = not self.columns[-1].has_preview()
-        target = self.columns[-1].target
-        if not result and target and target.is_file:
-            if self.fm.settings.preview_script and \
-                    self.fm.settings.use_preview_script:
-                try:
-                    result = not self.fm.previews[target.realpath]['foundpreview']
-                except Exception:
-                    return self.old_collapse
-
-        self.old_collapse = result
-        return result
-
     def click(self, event):
         if DisplayableContainer.click(self, event):
             return True
:36 -0700 6716' href='/akkartik/mu/commit/html/404stream.mu.html?h=main&id=828bc32057511bc88bd651f2e7c9cf19706378d3'>828bc320 ^
68df24fa ^
828bc320 ^
d3a9db3a ^
828bc320 ^


68df24fa ^

828bc320 ^
68df24fa ^
828bc320 ^
d3a9db3a ^
828bc320 ^
d3a9db3a ^
828bc320 ^

68df24fa ^

828bc320 ^
68df24fa ^
828bc320 ^
d3a9db3a ^
828bc320 ^



d3a9db3a ^
828bc320 ^
68df24fa ^

828bc320 ^


68df24fa ^

828bc320 ^

91a5f3e1 ^



2c56af2d ^
91a5f3e1 ^









2c56af2d ^
91a5f3e1 ^






828bc320 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131