##// END OF EJS Templates
Fix access from magics to shell storage database.
Fernando Perez -
Show More
@@ -1752,7 +1752,7 b' Currently the magic system has the following functions:\\n"""'
1752
1752
1753 try:
1753 try:
1754 stats = None
1754 stats = None
1755 with self.readline_no_record:
1755 with self.shell.readline_no_record:
1756 if 'p' in opts:
1756 if 'p' in opts:
1757 stats = self.magic_prun('', 0, opts, arg_lst, prog_ns)
1757 stats = self.magic_prun('', 0, opts, arg_lst, prog_ns)
1758 else:
1758 else:
@@ -2796,7 +2796,7 b' Defaulting color scheme to \'NoColor\'"""'
2796
2796
2797 par = parameter_s.strip()
2797 par = parameter_s.strip()
2798 if not par:
2798 if not par:
2799 stored = self.db.get('stored_aliases', {} )
2799 stored = self.shell.db.get('stored_aliases', {} )
2800 aliases = sorted(self.shell.alias_manager.aliases)
2800 aliases = sorted(self.shell.alias_manager.aliases)
2801 # for k, v in stored:
2801 # for k, v in stored:
2802 # atab.append(k, v[0])
2802 # atab.append(k, v[0])
@@ -2819,11 +2819,11 b' Defaulting color scheme to \'NoColor\'"""'
2819
2819
2820 aname = parameter_s.strip()
2820 aname = parameter_s.strip()
2821 self.shell.alias_manager.undefine_alias(aname)
2821 self.shell.alias_manager.undefine_alias(aname)
2822 stored = self.db.get('stored_aliases', {} )
2822 stored = self.shell.db.get('stored_aliases', {} )
2823 if aname in stored:
2823 if aname in stored:
2824 print "Removing %stored alias",aname
2824 print "Removing %stored alias",aname
2825 del stored[aname]
2825 del stored[aname]
2826 self.db['stored_aliases'] = stored
2826 self.shell.db['stored_aliases'] = stored
2827
2827
2828 def magic_rehashx(self, parameter_s = ''):
2828 def magic_rehashx(self, parameter_s = ''):
2829 """Update the alias table with all executable files in $PATH.
2829 """Update the alias table with all executable files in $PATH.
@@ -3036,7 +3036,7 b' Defaulting color scheme to \'NoColor\'"""'
3036 dhist = self.shell.user_ns['_dh']
3036 dhist = self.shell.user_ns['_dh']
3037 if oldcwd != cwd:
3037 if oldcwd != cwd:
3038 dhist.append(cwd)
3038 dhist.append(cwd)
3039 self.db['dhist'] = compress_dhist(dhist)[-100:]
3039 self.shell.db['dhist'] = compress_dhist(dhist)[-100:]
3040
3040
3041 else:
3041 else:
3042 os.chdir(self.shell.home_dir)
3042 os.chdir(self.shell.home_dir)
@@ -3305,7 +3305,7 b' Defaulting color scheme to \'NoColor\'"""'
3305 if len(args) > 2:
3305 if len(args) > 2:
3306 raise UsageError("%bookmark: too many arguments")
3306 raise UsageError("%bookmark: too many arguments")
3307
3307
3308 bkms = self.db.get('bookmarks',{})
3308 bkms = self.shell.db.get('bookmarks',{})
3309
3309
3310 if opts.has_key('d'):
3310 if opts.has_key('d'):
3311 try:
3311 try:
@@ -3340,7 +3340,7 b' Defaulting color scheme to \'NoColor\'"""'
3340 bkms[args[0]] = os.getcwdu()
3340 bkms[args[0]] = os.getcwdu()
3341 elif len(args)==2:
3341 elif len(args)==2:
3342 bkms[args[0]] = args[1]
3342 bkms[args[0]] = args[1]
3343 self.db['bookmarks'] = bkms
3343 self.shell.db['bookmarks'] = bkms
3344
3344
3345
3345
3346 def magic_pycat(self, parameter_s=''):
3346 def magic_pycat(self, parameter_s=''):
General Comments 0
You need to be logged in to leave comments. Login now