##// END OF EJS Templates
Fixing imports and syntax errors.
Brian Granger -
Show More
@@ -44,6 +44,7 b' from IPython.core.fakemodule import FakeModule, init_fakemod_dict'
44 from IPython.core.inputlist import InputList
44 from IPython.core.inputlist import InputList
45 from IPython.core.logger import Logger
45 from IPython.core.logger import Logger
46 from IPython.core.magic import Magic
46 from IPython.core.magic import Magic
47 from IPython.core.payload import PayloadManager
47 from IPython.core.plugin import PluginManager
48 from IPython.core.plugin import PluginManager
48 from IPython.core.prefilter import PrefilterManager
49 from IPython.core.prefilter import PrefilterManager
49 from IPython.core.displayhook import DisplayHook
50 from IPython.core.displayhook import DisplayHook
@@ -209,7 +210,7 b' class InteractiveShell(Configurable, Magic):'
209 display_trap = Instance('IPython.core.display_trap.DisplayTrap')
210 display_trap = Instance('IPython.core.display_trap.DisplayTrap')
210 extension_manager = Instance('IPython.core.extensions.ExtensionManager')
211 extension_manager = Instance('IPython.core.extensions.ExtensionManager')
211 plugin_manager = Instance('IPython.core.plugin.PluginManager')
212 plugin_manager = Instance('IPython.core.plugin.PluginManager')
212 payload_manager = Instance('IPython.core.paylaod.PayloadManager')
213 payload_manager = Instance('IPython.core.payload.PayloadManager')
213
214
214 def __init__(self, config=None, ipython_dir=None,
215 def __init__(self, config=None, ipython_dir=None,
215 user_ns=None, user_global_ns=None,
216 user_ns=None, user_global_ns=None,
@@ -19,7 +19,7 b' Authors:'
19 #-----------------------------------------------------------------------------
19 #-----------------------------------------------------------------------------
20
20
21 from IPython.config.configurable import Configurable
21 from IPython.config.configurable import Configurable
22 from IPython.utils.traitlets import Dict
22 from IPython.utils.traitlets import List
23
23
24 #-----------------------------------------------------------------------------
24 #-----------------------------------------------------------------------------
25 # Main payload class
25 # Main payload class
@@ -27,13 +27,15 b' from IPython.utils.traitlets import Dict'
27
27
28 class PayloadManager(Configurable):
28 class PayloadManager(Configurable):
29
29
30 _payload = Dict({})
30 _payload = List([])
31
31
32 def write_payload(self, key, value):
32 def write_payload(self, data):
33 self.payload[key] = value
33 if not isinstance(data, dict):
34 raise TypeError('Each payload write must be a dict, got: %r' % data)
35 self.payload.append(data)
34
36
35 def reset_payload(self):
37 def reset_payload(self):
36 self.payload = {}
38 self.payload = []
37
39
38 def read_payload(self):
40 def read_payload(self):
39 return self._payload
41 return self._payload
General Comments 0
You need to be logged in to leave comments. Login now