summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-06-28 00:48:42 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-06-28 00:48:42 +0100
commit15cb47d18cb2bdbaa4dab6beab6862c860890c76 (patch)
treecf838a9bebea774f4fac14a99aac0533dfab9d99
parent29ac9ec597c195f1325cc764594d6b57b019e23a (diff)
downloadpoezio-15cb47d18cb2bdbaa4dab6beab6862c860890c76.tar.gz
poezio-15cb47d18cb2bdbaa4dab6beab6862c860890c76.tar.bz2
poezio-15cb47d18cb2bdbaa4dab6beab6862c860890c76.tar.xz
poezio-15cb47d18cb2bdbaa4dab6beab6862c860890c76.zip
Simplify Tab.core to remove class variables.
-rw-r--r--poezio/tabs/basetabs.py30
1 files changed, 6 insertions, 24 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index 658c3feb..e287bc6d 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -81,9 +81,6 @@ STATE_PRIORITY = {
}
class Tab(object):
- tab_core = None
- size_manager = None
-
plugin_commands = {}
plugin_keys = {}
def __init__(self):
@@ -102,15 +99,11 @@ class Tab(object):
@property
def size(self):
- if not Tab.size_manager:
- Tab.size_manager = self.core.size
- return Tab.size_manager
+ return self.core.size
@property
def core(self):
- if not Tab.tab_core:
- Tab.tab_core = Singleton(core.Core)
- return Tab.tab_core
+ return Singleton(core.Core)
@property
def nb(self):
@@ -119,18 +112,6 @@ class Tab(object):
return index
return len(self.core.tabs)
- @property
- def tab_win(self):
- if not Tab.tab_core:
- Tab.tab_core = Singleton(core.Core)
- return Tab.tab_core.tab_win
-
- @property
- def left_tab_win(self):
- if not Tab.tab_core:
- Tab.tab_core = Singleton(core.Core)
- return Tab.tab_core.left_tab_win
-
@staticmethod
def tab_win_height():
"""
@@ -300,10 +281,11 @@ class Tab(object):
def refresh_tab_win(self):
if config.get('enable_vertical_tab_list'):
- if self.left_tab_win and not self.size.core_degrade_x:
- self.left_tab_win.refresh()
+ left_tab_win = self.core.left_tab_win
+ if left_tab_win and not self.size.core_degrade_x:
+ left_tab_win.refresh()
elif not self.size.core_degrade_y:
- self.tab_win.refresh()
+ self.core.tab_win.refresh()
def refresh(self):
"""