summaryrefslogtreecommitdiff
path: root/asciifarm/client/main.py
diff options
context:
space:
mode:
authortroido <troido@hotmail.com>2017-12-30 22:24:02 +0100
committertroido <troido@hotmail.com>2017-12-30 22:24:02 +0100
commit2170dc1bbfe845c2b5ae0a34d5608cd836627cec (patch)
treea97979d3cc249b7a8157f21ec9d0e58165a3262a /asciifarm/client/main.py
parentf62cb51a6b69abb48b76db8b3166f94bcfe66ba2 (diff)
keybindings can be imported now, though it will probably require some hackery
Diffstat (limited to 'asciifarm/client/main.py')
-rwxr-xr-xasciifarm/client/main.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/asciifarm/client/main.py b/asciifarm/client/main.py
index 365c647..274a6df 100755
--- a/asciifarm/client/main.py
+++ b/asciifarm/client/main.py
@@ -35,7 +35,7 @@ def main(argv=None):
parser.add_argument('-n', '--name', help='Your player name (must be unique!). Defaults to username', default=getpass.getuser())
parser.add_argument("-a", "--address", help="The address of the socket. When the socket type is 'abstract' this is just a name. When it is 'unix' this is a filename. When it is 'inet' is should be in the format 'address:port', eg 'localhost:8080'. Defaults depends on the socket type")
parser.add_argument("-s", "--socket", help="the socket type. 'unix' is unix domain sockets, 'abstract' is abstract unix domain sockets and 'inet' is inet sockets. ", choices=["abstract", "unix", "inet"], default="abstract")
- parser.add_argument('-k', '--keybindings', help='The file with the keybindings. If it is either of these names: {} it will be loaded from the keybindings directory.'.format(standardKeyFiles), default="default")
+ parser.add_argument('-k', '--keybindings', help='The script with the keybindings. This can be either a python3 or a hy script.')
parser.add_argument('-c', '--characters', help='The file with the character mappings for the graphics. If it is either of these names: {} it will be loaded from the charmaps directory.'.format(standardCharFiles), default="default")
parser.add_argument('-o', '--logfile', help='All game messages will be written to this file.'.format(standardCharFiles), default=None)
@@ -50,10 +50,11 @@ def main(argv=None):
with open(charFile, 'r') as cf:
charMap = json.load(cf)
keyFile = args.keybindings
- if keyFile in standardKeyFiles:
- keyFile = os.path.join(keybindingsPath, keyFile + ".json")
- with open(keyFile, 'r') as kf:
- keybindings = json.load(kf)
+ if keyFile:
+ with open(keyFile, 'r') as kf:
+ keybindings = json.load(kf)
+ else:
+ keybindings = None
address = args.address
if address == None: