From 920b341344d90d0bc294352eb2bc35326094c64c Mon Sep 17 00:00:00 2001 From: XavierCLL Date: Fri, 24 Mar 2017 14:18:44 -0500 Subject: [PATCH] Updated charm --- charm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) mode change 100755 => 100644 charm diff --git a/charm b/charm old mode 100755 new mode 100644 index 29c4302..0523f73 --- a/charm +++ b/charm @@ -10,13 +10,14 @@ import time # see com.intellij.idea.SocketLock for the server side of this interface RUN_PATH = u'/opt/pycharm-professional/bin/pycharm.sh' -CONFIG_PATH = u'~/.PyCharm2016.3/config' -SYSTEM_PATH = u'~/.PyCharm2016.3/system' +CONFIG_PATH = u'~/.PyCharm2017.1/config' +SYSTEM_PATH = u'~/.PyCharm2017.1/system' def print_usage(cmd): print(('Usage:\n' + ' {0} -h | -? | --help\n' + - ' {0} [-l|--line line] file[:line]\n' + + ' {0} [project_dir]\n' + + ' {0} [-l|--line line] [project_dir|--temp-project] file[:line]\n' + ' {0} diff \n' + ' {0} merge [base] ').format(cmd)) @@ -40,16 +41,14 @@ def process_args(argv): args.append(arg) skip_next = False else: + path = arg if ':' in arg: file_path, line_number = arg.rsplit(':', 1) if line_number.isdigit(): args.append('-l') args.append(line_number) - args.append(os.path.abspath(file_path)) - else: - args.append(os.path.abspath(arg)) - else: - args.append(os.path.abspath(arg)) + path = file_path + args.append(os.path.abspath(path)) return args @@ -60,8 +59,9 @@ def try_activate_instance(args): if not (os.path.exists(port_path) and os.path.exists(token_path)): return False - with open(port_path) as pf, open(token_path) as tf: + with open(port_path) as pf: port = int(pf.read()) + with open(token_path) as tf: token = tf.read() s = socket.socket()