##// END OF EJS Templates
Merge pull request #8100 from minrk/parallel-allow-none...
Thomas Kluyver -
r20803:8cd36825 merge
parent child Browse files
Show More
@@ -114,8 +114,6 b' class BaseLauncher(LoggingConfigurable):'
114 super(BaseLauncher, self).__init__(work_dir=work_dir, config=config, **kwargs)
114 super(BaseLauncher, self).__init__(work_dir=work_dir, config=config, **kwargs)
115 self.state = 'before' # can be before, running, after
115 self.state = 'before' # can be before, running, after
116 self.stop_callbacks = []
116 self.stop_callbacks = []
117 self.start_data = None
118 self.stop_data = None
119
117
120 @property
118 @property
121 def args(self):
119 def args(self):
@@ -368,7 +366,6 b' class LocalEngineSetLauncher(LocalEngineLauncher):'
368 super(LocalEngineSetLauncher, self).__init__(
366 super(LocalEngineSetLauncher, self).__init__(
369 work_dir=work_dir, config=config, **kwargs
367 work_dir=work_dir, config=config, **kwargs
370 )
368 )
371 self.stop_data = {}
372
369
373 def start(self, n):
370 def start(self, n):
374 """Start n engines by profile or profile_dir."""
371 """Start n engines by profile or profile_dir."""
@@ -1,10 +1,6 b''
1 """A Task logger that presents our DB interface,
1 """A Task logger that presents our DB interface,
2 but exists entirely in memory and implemented with dicts.
2 but exists entirely in memory and implemented with dicts.
3
3
4 Authors:
5
6 * Min RK
7
8
4
9 TaskRecords are dicts of the form::
5 TaskRecords are dicts of the form::
10
6
@@ -36,14 +32,17 b' DictDB supports a subset of mongodb operators::'
36
32
37 $lt,$gt,$lte,$gte,$ne,$in,$nin,$all,$mod,$exists
33 $lt,$gt,$lte,$gte,$ne,$in,$nin,$all,$mod,$exists
38 """
34 """
39 #-----------------------------------------------------------------------------
35
40 # Copyright (C) 2010-2011 The IPython Development Team
36 # Copyright (c) IPython Development Team.
41 #
37 # Distributed under the terms of the Modified BSD License.
42 # Distributed under the terms of the BSD License. The full license is in
38
43 # the file COPYING, distributed as part of this software.
39 import copy
44 #-----------------------------------------------------------------------------
40 from copy import deepcopy
45
41
46 from copy import deepcopy as copy
42 # Python can't copy memoryviews, but creating another memoryview works for us
43 copy._deepcopy_dispatch[memoryview] = lambda x, memo: memoryview(x)
44
45
47 from datetime import datetime
46 from datetime import datetime
48
47
49 from IPython.config.configurable import LoggingConfigurable
48 from IPython.config.configurable import LoggingConfigurable
@@ -146,7 +145,7 b' class DictDB(BaseDB):'
146
145
147 for rec in itervalues(self._records):
146 for rec in itervalues(self._records):
148 if self._match_one(rec, tests):
147 if self._match_one(rec, tests):
149 matches.append(copy(rec))
148 matches.append(deepcopy(rec))
150 return matches
149 return matches
151
150
152 def _extract_subdict(self, rec, keys):
151 def _extract_subdict(self, rec, keys):
@@ -155,7 +154,7 b' class DictDB(BaseDB):'
155 d['msg_id'] = rec['msg_id']
154 d['msg_id'] = rec['msg_id']
156 for key in keys:
155 for key in keys:
157 d[key] = rec[key]
156 d[key] = rec[key]
158 return copy(d)
157 return deepcopy(d)
159
158
160 # methods for monitoring size / culling history
159 # methods for monitoring size / culling history
161
160
@@ -225,7 +224,7 b' class DictDB(BaseDB):'
225 raise KeyError("Record %r has been culled for size" % msg_id)
224 raise KeyError("Record %r has been culled for size" % msg_id)
226 if not msg_id in self._records:
225 if not msg_id in self._records:
227 raise KeyError("No such msg_id %r"%(msg_id))
226 raise KeyError("No such msg_id %r"%(msg_id))
228 return copy(self._records[msg_id])
227 return deepcopy(self._records[msg_id])
229
228
230 def update_record(self, msg_id, rec):
229 def update_record(self, msg_id, rec):
231 """Update the data in an existing record."""
230 """Update the data in an existing record."""
General Comments 0
You need to be logged in to leave comments. Login now