From d5a0ae4696f2b63700370a74d04287e3e077084f Mon Sep 17 00:00:00 2001 From: wes Date: Sun, 3 Jul 2011 17:03:59 -0400 Subject: [PATCH] fixed relative path issue --- irc_speak.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/irc_speak.py b/irc_speak.py index 2a1f8aa..43af2ff 100644 --- a/irc_speak.py +++ b/irc_speak.py @@ -8,8 +8,11 @@ except ImportError as exception: import xchat import argparse +import os from espeak import espeak +options_path = os.path.expanduser("~/.xchat2/options.json") + __module_name__ = "IRC Speak" __module_version__ = "1.1" __module_description__ = "Allows you to make certain users' text run through a voice synthesizer" @@ -26,7 +29,7 @@ editor.add_argument("-rate", nargs=1, type=int, default=[175], help="default=175 editor.add_argument("-vrange", nargs=1, type=int, default=[50], help="default=50") editor.add_argument("-language", nargs=1, type=str, help="type \"/ircspeak langlist\" to get a list of languages", default=["english"]) -options = json.load(open("/home/wes/.xchat2/options.json", "rw")) +options = json.load(open(options_path, "rw")) aliases = {"rate" : 1, "volume" : 2, @@ -69,7 +72,7 @@ def set_user(arguments): return "Exited with status %s" % (exception) def save(arguments): - with open('/home/wes/.xchat2/options.json', mode='w') as jsonfile: + with open(options_path, mode='w') as jsonfile: json.dump(options, jsonfile) return "Saved!"