def _modify_entry(self, doc_entry, path_to_new_content, file_ext):
        """Replace content of a DocEntry.

        Args:
          doc_entry: DocEntry whose content will be replaced.
          path_to_new_content: str Path to file that has new content.
          file_ext: str Extension to use to determine MIME type of upload
                    (e.g. 'txt', 'doc')

        """
        from gdata.docs.service import SUPPORTED_FILETYPES
        try:
            content_type = SUPPORTED_FILETYPES[file_ext.upper()]
        except __HOLE__:
            print 'Could not find mimetype for ' + file_ext
            while file_ext not in SUPPORTED_FILETYPES.keys():
                file_ext = raw_input('Please enter one of ' +
                                     SUPPORTED_FILETYPES.keys() +
                                     ' for a content type to upload as.')
            content_type = SUPPORTED_FILETYPES[file_ext.upper()]
        mediasource = gdata.MediaSource(file_path=path_to_new_content,
                                        content_type=content_type)
        return self.Put(mediasource, doc_entry.GetEditMediaLink().href)
dataset/ETHPy150Open vinitkumar/googlecl/src/googlecl/docs/service.py/DocsServiceCL._modify_entry