From 2170dc1bbfe845c2b5ae0a34d5608cd836627cec Mon Sep 17 00:00:00 2001 From: troido Date: Sat, 30 Dec 2017 22:24:02 +0100 Subject: keybindings can be imported now, though it will probably require some hackery --- asciifarm/client/gameclient.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'asciifarm/client/gameclient.py') diff --git a/asciifarm/client/gameclient.py b/asciifarm/client/gameclient.py index 9ba4b37..914d90c 100644 --- a/asciifarm/client/gameclient.py +++ b/asciifarm/client/gameclient.py @@ -13,11 +13,12 @@ import string from .display.display import Display import hy +from . import keybindings as defaultkeybindings import importlib class Client: - def __init__(self, stdscr, display, name, connection, keybindings, logFile=None): + def __init__(self, stdscr, display, name, connection, keybindings=None, logFile=None): self.stdscr = stdscr self.display = display self.name = name @@ -25,8 +26,9 @@ class Client: self.connection = connection self.logFile = logFile - - keymodule = importlib.import_module(".keybindings", __package__) + keymodule = defaultkeybindings + if keybindings: + keymodule = importlib.import_module(keybindings) self.commands = keymodule.commands self.controlsString = keymodule.docs -- cgit