Show More
@@ -0,0 +1,39 b'' | |||
|
1 | # -*- coding: utf-8 -*- | |
|
2 | """Payload system for IPython. | |
|
3 | ||
|
4 | Authors: | |
|
5 | ||
|
6 | * Fernando Perez | |
|
7 | * Brian Granger | |
|
8 | """ | |
|
9 | ||
|
10 | #----------------------------------------------------------------------------- | |
|
11 | # Copyright (C) 2008-2010 The IPython Development Team | |
|
12 | # | |
|
13 | # Distributed under the terms of the BSD License. The full license is in | |
|
14 | # the file COPYING, distributed as part of this software. | |
|
15 | #----------------------------------------------------------------------------- | |
|
16 | ||
|
17 | #----------------------------------------------------------------------------- | |
|
18 | # Imports | |
|
19 | #----------------------------------------------------------------------------- | |
|
20 | ||
|
21 | from IPython.config.configurable import Configurable | |
|
22 | from IPython.utils.traitlets import Dict | |
|
23 | ||
|
24 | #----------------------------------------------------------------------------- | |
|
25 | # Main payload class | |
|
26 | #----------------------------------------------------------------------------- | |
|
27 | ||
|
28 | class PayloadManager(Configurable): | |
|
29 | ||
|
30 | _payload = Dict({}) | |
|
31 | ||
|
32 | def write_payload(self, key, value): | |
|
33 | self.payload[key] = value | |
|
34 | ||
|
35 | def reset_payload(self): | |
|
36 | self.payload = {} | |
|
37 | ||
|
38 | def read_payload(self): | |
|
39 | return self._payload |
General Comments 0
You need to be logged in to leave comments.
Login now