def write(self, directory): """Write the current status to `directory`.""" status_file = os.path.join(directory, self.STATUS_FILE) status = { 'format': self.STATUS_FORMAT, 'version': coverage.__version__, 'settings': self.settings, 'files': self.files, } with open(status_file, "wb") as fout: pickle.dump(status, fout)
def write(self, directory): status_file = os.path.join(directory, self.STATUS_FILE) status = {'format': self.STATUS_FORMAT, 'version': coverage.__version__, 'settings': self.settings, 'files': self.files} fout = open(status_file, 'wb') try: pickle.dump(status, fout) finally: fout.close()
def write_pickled_file(self, covdata, filename): """Write coverage data as pickled `filename`.""" # Create the file data. file_data = {} if covdata._arcs: file_data['arcs'] = dict((f, list(amap)) for f, amap in iitems(covdata._arcs)) else: file_data['lines'] = dict((f, list(lmap)) for f, lmap in iitems(covdata._lines)) # Write the pickle to the file. with open(filename, 'wb') as file_obj: pickle.dump(file_data, file_obj, 2)
def write(self, directory): status_file = os.path.join(directory, self.STATUS_FILE) status = { 'format': self.STATUS_FORMAT, 'version': coverage.__version__, 'settings': self.settings, 'files': self.files } fout = open(status_file, 'wb') try: pickle.dump(status, fout) finally: fout.close()
def write_pickled_file(self, covdata, filename): """Write coverage data as pickled `filename`.""" # Create the file data. file_data = {} if covdata._arcs: file_data['arcs'] = dict( (f, list(amap)) for f, amap in iitems(covdata._arcs)) else: file_data['lines'] = dict( (f, list(lmap)) for f, lmap in iitems(covdata._lines)) # Write the pickle to the file. with open(filename, 'wb') as file_obj: pickle.dump(file_data, file_obj, 2)
def write_file(self, filename): data = {} data['lines'] = self.line_data() arcs = self.arc_data() if arcs: data['arcs'] = arcs if self.collector: data['collector'] = self.collector if self.debug and self.debug.should('dataio'): self.debug.write('Writing data to %r' % (filename,)) fdata = open(filename, 'wb') try: pickle.dump(data, fdata, 2) finally: fdata.close()
def write_file(self, filename): data = {} data['lines'] = self.line_data() arcs = self.arc_data() if arcs: data['arcs'] = arcs if self.collector: data['collector'] = self.collector if self.debug and self.debug.should('dataio'): self.debug.write('Writing data to %r' % (filename, )) fdata = open(filename, 'wb') try: pickle.dump(data, fdata, 2) finally: fdata.close()
def write(self, file_obj): """Write the coverage data to `file_obj`.""" # Create the file data. file_data = {} file_data['lines'] = dict((f, list(lmap.keys())) for f, lmap in iitems(self._lines)) if self._arcs: file_data['arcs'] = dict((f, list(amap.keys())) for f, amap in iitems(self._arcs)) if self._collector: file_data['collector'] = self._collector file_data['plugins'] = self._plugins # Write the pickle to the file. pickle.dump(file_data, file_obj, 2)
def write_file(self, filename): """Write the coverage data to `filename`.""" # Create the file data. data = {} data['lines'] = self.line_data() arcs = self.arc_data() if arcs: data['arcs'] = arcs if self.collector: data['collector'] = self.collector if self.debug and self.debug.should('dataio'): self.debug.write("Writing data to %r" % (filename,)) # Write the pickle to the file. with open(filename, 'wb') as fdata: pickle.dump(data, fdata, 2)
def write_file(self, filename): """Write the coverage data to `filename`.""" # Create the file data. data = {} data['lines'] = self.line_data() arcs = self.arc_data() if arcs: data['arcs'] = arcs if self.collector: data['collector'] = self.collector if self.debug and self.debug.should('dataio'): self.debug.write("Writing data to %r" % (filename, )) # Write the pickle to the file. with open(filename, 'wb') as fdata: pickle.dump(data, fdata, 2)
def write_file(self, filename): """Write the coverage data to `filename`.""" # Create the file data. data = {} data['lines'] = self.line_data() arcs = self.arc_data() if arcs: data['arcs'] = arcs if self.collector: data['collector'] = self.collector # Write the pickle to the file. fdata = open(filename, 'wb') try: pickle.dump(data, fdata, 2) finally: fdata.close()
def write_file(self, filename): """Write the coverage data to `filename`.""" # Create the file data. data = {} data["lines"] = self.line_data() arcs = self.arc_data() if arcs: data["arcs"] = arcs if self.collector: data["collector"] = self.collector if self.debug and self.debug.should("dataio"): self.debug.write("Writing data to %r" % (filename,)) # Write the pickle to the file. fdata = open(filename, "wb") try: pickle.dump(data, fdata, 2) finally: fdata.close()