1
0
mirror of https://github.com/wting/autojump synced 2024-09-28 05:50:47 +00:00

Merge pull request #214 from khughitt/master

Updated IPython plugin to support Python 3.x
This commit is contained in:
William Ting 2013-06-05 09:46:38 -07:00
commit d692bc644a

View File

@ -24,9 +24,9 @@ ip = get_ipython()
@register_line_magic @register_line_magic
def j(path): def j(path):
cmd = ['autojump'] + path.split() cmd = ['autojump'] + path.split()
newpath = sub.Popen(cmd, stdout=sub.PIPE, shell=False).communicate()[0][:-1] # delete last '\n' newpath = sub.Popen(cmd, stdout=sub.PIPE, shell=False).communicate()[0].strip()
if newpath: if newpath:
ip.magic('cd %s' % newpath) ip.magic('cd %s' % newpath.decode('utf-8'))
# remove from namespace # remove from namespace
del j del j