storemagic needs to use self.shell #2099

Closed
takluyver opened this Issue Jul 5, 2012 · 1 comment

Projects

None yet

3 participants

@takluyver
Owner

As reported on the mailing list

AttributeError                            Traceback (most recent call last)
<ipython-input-3-6795157a19c8> in <module>()
----> 1 get_ipython().magic(u'store')

C:\Python26\ArcGIS10.0\lib\site-packages\IPython\core\interactiveshell.pyc in magic(self, arg_s)
   2159         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2160         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2161         return self.run_line_magic(magic_name, magic_arg_s)
   2162
   2163     #-------------------------------------------------------------------------

C:\Python26\ArcGIS10.0\lib\site-packages\IPython\core\interactiveshell.pyc in run_line_magic(self, magic_name, line)
   2085                 args.append(sys._getframe(stack_depth).f_locals)
   2086             with self.builtin_trap:
-> 2087                 result = fn(*args)
   2088             return result
   2089

C:\Python26\ArcGIS10.0\lib\site-packages\IPython\extensions\storemagic.pyc in store(self, parameter_s)

C:\Python26\ArcGIS10.0\lib\site-packages\IPython\core\magic.pyc in <lambda>(f, *a, **k)

    189     # but it's overkill for just that one bit of state.
    190     def magic_deco(arg):
--> 191         call = lambda f, *a, **k: f(*a, **k)
    192
    193         if callable(arg):

C:\Python26\ArcGIS10.0\lib\site-packages\IPython\extensions\storemagic.pyc in store(self, parameter_s)

    141         # run without arguments -> list variables & values
    142         elif not args:
--> 143             vars = self.db.keys('autorestore/*')
    144             vars.sort(
    145             if vars:

AttributeError: 'StoreMagics' object has no attribute 'db'
Owner
fperez commented Jul 5, 2012

Ouch, let's add a test as well so we catch it in the future. Thanks for the quick followup with a report.

@minrk minrk closed this in 7fedb4a Jul 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment