diff options
| author | troido <troido@hotmail.com> | 2017-12-30 22:24:02 +0100 |
|---|---|---|
| committer | troido <troido@hotmail.com> | 2017-12-30 22:24:02 +0100 |
| commit | 2170dc1bbfe845c2b5ae0a34d5608cd836627cec (patch) | |
| tree | a97979d3cc249b7a8157f21ec9d0e58165a3262a /asciifarm/client/gameclient.py | |
| parent | f62cb51a6b69abb48b76db8b3166f94bcfe66ba2 (diff) | |
keybindings can be imported now, though it will probably require some hackery
Diffstat (limited to 'asciifarm/client/gameclient.py')
| -rw-r--r-- | asciifarm/client/gameclient.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 |
