def __init__(self, options, partition_id, process_index):
     self._options = options
     self._partition_id = partition_id
     self._process_index = process_index
     self._begin_index = None
     self._end_index = None
     self._buffer = []
     self._tmp_fpath = common.gen_tmp_fpath(
         os.path.join(self._options.output_dir,
                      common.partition_repr(self._partition_id)))
Beispiel #2
0
 def __init__(self, options, partition_id):
     self._partition_id = partition_id
     self._writer = None
     self._begin_index = None
     self._end_index = None
     self._options = options
     self._size_bytes = 0
     self._tmp_fpath = common.gen_tmp_fpath(
         os.path.join(self._options.output_dir,
                      common.partition_repr(self._partition_id)))
 def _get_tmp_fpath(self):
     return gen_tmp_fpath(self._get_data_block_dir())
 def _get_tmp_fpath(self):
     return common.gen_tmp_fpath(self._example_dumped_dir)
 def _get_tmp_fpath(self):
     return common.gen_tmp_fpath(self._get_output_dir())
Beispiel #6
0
 def _gen_tmp_fpath(self):
     return gen_tmp_fpath(self._output_dir)
def dump_rsa_key_as_pem(output_dir, key, fname):
    tmp_fpath = common.gen_tmp_fpath(output_dir)
    with gfile.GFile(tmp_fpath, 'w') as wf:
        wf.write(key.save_pkcs1())
    key_fpath = os.path.join(output_dir, fname)
    gfile.Rename(tmp_fpath, key_fpath)
Beispiel #8
0
 def _get_output_writer(self):
     if self._writer is None:
         self._tmp_fpath = common.gen_tmp_fpath(self._merged_dir)
         self._writer = create_output_writer(self._writer_options,
                                             self._tmp_fpath)
     return self._writer
Beispiel #9
0
 def _get_csv_dict_writer(self):
     if self._csv_dict_writer is None:
         self._tmp_fpath = common.gen_tmp_fpath(self._merged_dir)
         self._csv_dict_writer = \
                 csv_dict_writer.CsvDictWriter(self._tmp_fpath)
     return self._csv_dict_writer