From b9c6f08a790358c990462287bed2062257c5ba7a Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 6 Nov 2011 16:50:10 +0100 Subject: =?UTF-8?q?Wasn=E2=80=99t=20that=20already=20remove,=20like,=20TWI?= =?UTF-8?q?CE=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/core.py') diff --git a/src/core.py b/src/core.py index 8c4ad258..c1220e4b 100644 --- a/src/core.py +++ b/src/core.py @@ -124,7 +124,6 @@ class Core(object): 'connect': (self.command_reconnect, _('Usage: /connect\nConnect: disconnect from the remote server if you are currently connected and then connect to it again'), None), 'server_cycle': (self.command_server_cycle, _('Usage: /server_cycle [domain] [message]\nServer Cycle: disconnect and reconnects in all the rooms in domain.'), None), 'bind': (self.command_bind, _('Usage: /bind \nBind: bind a key to an other key or to a “command”. For example "/bind ^H KEY_UP" makes Control + h do the same same than the Up key.'), None), -# nope 'pubsub': (self.command_pubsub, _('Usage: /pubsub \nPubsub: Open a pubsub browser on the given domain'), None), } self.key_func = { @@ -144,7 +143,6 @@ class Core(object): 'M-z': self.go_to_previous_tab, '^L': self.full_screen_redraw, 'M-j': self.go_to_room_number, -# 'M-c': self.coucou, } # Add handlers @@ -170,9 +168,6 @@ class Core(object): self.timed_events = set() - def coucou(self): - self.command_pubsub('pubsub.louiz.org') - def start(self): """ Init curses, create the first tab, etc @@ -206,7 +201,6 @@ class Core(object): self.information_win.resize(self.information_win_size, tabs.Tab.width, tabs.Tab.height - 2 - self.information_win_size, 0) - def resize_global_info_bar(self): """ Resize the GlobalInfoBar only once at each resize -- cgit v1.2.3 From 200019574d66c1a04d25e23eb0a0fcda7c25f445 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 6 Nov 2011 17:08:40 +0100 Subject: Use threads RLock to avoid crash on simultaneous refresh and resize. fixes #2180 --- src/core.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/core.py') diff --git a/src/core.py b/src/core.py index c1220e4b..29748f4b 100644 --- a/src/core.py +++ b/src/core.py @@ -45,6 +45,7 @@ from contact import Contact, Resource from text_buffer import TextBuffer from keyboard import read_char from theming import get_theme +from windows import g_lock # http://xmpp.org/extensions/xep-0045.html#errorstatus ERROR_AND_STATUS_CODES = { @@ -67,8 +68,6 @@ possible_show = {'available':None, 'xa':'xa' } -resize_lock = threading.Lock() - Status = collections.namedtuple('Status', 'show message') class Core(object): @@ -198,14 +197,16 @@ class Core(object): """ Resize the global_information_win only once at each resize. """ - self.information_win.resize(self.information_win_size, tabs.Tab.width, - tabs.Tab.height - 2 - self.information_win_size, 0) + with g_lock: + self.information_win.resize(self.information_win_size, tabs.Tab.width, + tabs.Tab.height - 2 - self.information_win_size, 0) def resize_global_info_bar(self): """ Resize the GlobalInfoBar only once at each resize """ - self.tab_win.resize(1, tabs.Tab.width, tabs.Tab.height - 2, 0) + with g_lock: + self.tab_win.resize(1, tabs.Tab.width, tabs.Tab.height - 2, 0) def on_exception(self, typ, value, trace): """ @@ -692,7 +693,7 @@ class Core(object): tabs.Tab.resize(self.stdscr) self.resize_global_information_win() self.resize_global_info_bar() - with resize_lock: + with g_lock: for tab in self.tabs: if config.get('lazy_resize', 'true') == 'true': tab.need_resize = True -- cgit v1.2.3