(self, state)
| 225 | return self.chunks, self.filenames, self.chunk_length |
| 226 | |
| 227 | def __setstate__(self, state): |
| 228 | self.__init__() |
| 229 | chunks, filenames, self.chunk_length = state |
| 230 | |
| 231 | file_mapping = {} |
| 232 | self.filenames = set() |
| 233 | self.chunks = [] |
| 234 | |
| 235 | for filename in filenames: |
| 236 | if not os.path.exists(filename): |
| 237 | continue |
| 238 | |
| 239 | try: |
| 240 | handle, new_filename = tempfile.mkstemp(prefix=MKSTEMP_PREFIX.BIG_ARRAY) |
| 241 | os.close(handle) |
| 242 | shutil.copyfile(filename, new_filename) |
| 243 | self.filenames.add(new_filename) |
| 244 | file_mapping[filename] = new_filename |
| 245 | except (OSError, IOError): |
| 246 | pass |
| 247 | |
| 248 | for chunk in chunks: |
| 249 | if isinstance(chunk, STRING_TYPES): |
| 250 | if chunk in file_mapping: |
| 251 | self.chunks.append(file_mapping[chunk]) |
| 252 | else: |
| 253 | errMsg = "exception occurred while restoring BigArray chunk " |
| 254 | errMsg += "from file '%s'" % chunk |
| 255 | raise SqlmapSystemException(errMsg) |
| 256 | else: |
| 257 | self.chunks.append(chunk) |
| 258 | |
| 259 | def __getitem__(self, y): |
| 260 | with self._lock: |
nothing calls this directly
no test coverage detected