def _transmit_doc(self, path, entry_title, post_uri, content_type, file_ext):
        """Upload a document.

        The final step in uploading a document. The process differs between versions
        of the gdata python client library, hence its definition here.

        Args:
          path: Path to the file to upload.
          entry_title: Name of the document.
          post_uri: URI to make request to.
          content_type: MIME type of request.
          file_ext: File extension that determined the content_type.

        Returns:
          Entry representing the document uploaded.
        """
        media = gdata.MediaSource(file_path=path, content_type=content_type)
        try:
            # Upload() wasn't added until later versions of DocsService, so
            # we may not have it.
            return self.Upload(media, entry_title, post_uri)
        except __HOLE__:
            import atom
            entry = gdata.docs.DocumentListEntry()
            entry.title = atom.Title(text=entry_title)
            # Cover the supported filetypes in gdata-2.0.10 even though
            # they aren't listed in gdata 1.2.4... see what happens.
            if file_ext.lower() in ['csv', 'tsv', 'tab', 'ods', 'xls', 'xlsx']:
                category = _make_kind_category(googlecl.docs.SPREADSHEET_LABEL)
            elif file_ext.lower() in ['ppt', 'pps']:
                category = _make_kind_category(
                    googlecl.docs.PRESENTATION_LABEL)
            elif file_ext.lower() in ['pdf']:
                category = _make_kind_category(googlecl.docs.PDF_LABEL)
            # Treat everything else as a document
            else:
                category = _make_kind_category(googlecl.docs.DOCUMENT_LABEL)
            entry.category.append(category)
            # To support uploading to folders for earlier
            # versions of the API, expose the lower-level Post
            return self.Post(entry, post_uri, media_source=media,
                             extra_headers={'Slug': media.file_name},
                             converter=gdata.docs.DocumentListEntryFromString)
dataset/ETHPy150Open vinitkumar/googlecl/src/googlecl/docs/service.py/DocsServiceCL._transmit_doc