summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavierCLL2017-06-15 19:18:01 -0500
committerXavierCLL2017-06-15 19:18:01 -0500
commit7a354b9e3491581dcf1443e3b50c08978831f5c1 (patch)
treedfdccb8d76f58b95da749ad3adc89bdb66d2cf5f
parent84ff511013ad368f47f1ff2f7c932ecfca97f29d (diff)
downloadaur-7a354b9e3491581dcf1443e3b50c08978831f5c1.tar.gz
updated charm
-rw-r--r--charm8
1 files changed, 4 insertions, 4 deletions
diff --git a/charm b/charm
index 0523f731dde..11101305833 100644
--- a/charm
+++ b/charm
@@ -13,6 +13,7 @@ RUN_PATH = u'/opt/pycharm-professional/bin/pycharm.sh'
CONFIG_PATH = u'~/.PyCharm2017.1/config'
SYSTEM_PATH = u'~/.PyCharm2017.1/system'
+
def print_usage(cmd):
print(('Usage:\n' +
' {0} -h | -? | --help\n' +
@@ -30,9 +31,7 @@ def process_args(argv):
if arg == '-h' or arg == '-?' or arg == '--help':
print_usage(argv[0])
exit(0)
- elif arg == 'diff' and i == 0:
- args.append(arg)
- elif arg == 'merge' and i == 0:
+ elif i == 0 and (arg == 'diff' or arg == 'merge' or arg == '--temp-project'):
args.append(arg)
elif arg == '-l' or arg == '--line':
args.append(arg)
@@ -75,7 +74,7 @@ def try_activate_instance(args):
while True:
try:
path_len = struct.unpack('>h', s.recv(2))[0]
- path = s.recv(path_len)
+ path = s.recv(path_len).decode('utf-8')
if os.path.abspath(path) == os.path.abspath(CONFIG_PATH):
found = True
break
@@ -84,6 +83,7 @@ def try_activate_instance(args):
if found:
cmd = 'activate ' + token + '\0' + os.getcwd() + '\0' + '\0'.join(args)
+ if sys.version_info.major >= 3: cmd = cmd.encode('utf-8')
encoded = struct.pack('>h', len(cmd)) + cmd
s.send(encoded)
time.sleep(0.5) # don't close the socket immediately