Example #1
0
 def get_data_item(self, data_id):
     if data.is_file_in_stash(self.get_filename(data_id)):
         with data.open_data_file_in_stash(self.get_filename(data_id), utils.READ_BINARY_MODE) as data_item:
             return data_id, data_item.read()
Example #2
0
 def open_file(self, data_id):
     with data.open_data_file_in_stash(self.get_filename(data_id), utils.READ_BINARY_MODE) as data_item:
         data_block = data_item.read()
         return data_block
Example #3
0
 def add_file(self, data_id, main_part):
     with data.open_data_file_in_stash(self.get_filename(data_id), utils.WRITE_BINARY_MODE) as data_item:
         data_item.write(main_part)
Example #4
0
 def get_data_item(self, data_id):
     if data.is_file_in_stash(self.get_filename(data_id)):
         with data.open_data_file_in_stash(
                 self.get_filename(data_id),
                 utils.READ_BINARY_MODE) as data_item:
             return data_id, data_item.read()
Example #5
0
 def open_file(self, data_id):
     with data.open_data_file_in_stash(self.get_filename(data_id),
                                       utils.READ_BINARY_MODE) as data_item:
         data_block = data_item.read()
         return data_block
Example #6
0
 def add_file(self, data_id, main_part):
     with data.open_data_file_in_stash(
             self.get_filename(data_id),
             utils.WRITE_BINARY_MODE) as data_item:
         data_item.write(main_part)