mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Added Python 3 support for autojump IPython plugin
This commit is contained in:
parent
fca26f3ef4
commit
07c0313430
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user