Commit 7c7f9b2f authored by mathieui's avatar mathieui

Do not instantiate Keyboard at module-level

parent 8def5609
......@@ -37,7 +37,7 @@ from contact import Contact, Resource
from daemon import Executor
from data_forms import DataFormsTab
from fifo import Fifo
from keyboard import keyboard
from keyboard import Keyboard
from logger import logger
from plugin_manager import PluginManager
from roster import roster
......@@ -69,6 +69,7 @@ class Core(object):
self.running = True
self.xmpp = singleton.Singleton(connection.Connection)
self.xmpp.core = self
self.keyboard = Keyboard()
roster.set_node(self.xmpp.client_roster)
decorators.refresh_wrapper.core = self
self.paused = False
......@@ -1390,10 +1391,10 @@ class Core(object):
occurs. In that case we do not return (we loop until we get
a non-None value), but we check for timed events instead.
"""
res = keyboard.get_user_input(self.stdscr)
res = self.keyboard.get_user_input(self.stdscr)
while res is None:
self.check_timed_events()
res = keyboard.get_user_input(self.stdscr)
res = self.keyboard.get_user_input(self.stdscr)
return res
def escape_next_key(self):
......
......@@ -180,9 +180,8 @@ class Keyboard(object):
self.escape = False
return ret_list
keyboard = Keyboard()
if __name__ == '__main__':
keyboard = Keyboard()
s = curses.initscr()
curses.noecho()
curses.cbreak()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment