Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
From af2a754c5f89945a9f38e1006c6d84bc44cef554 Mon Sep 17 00:00:00 2001
From: lfborjas <luis.borjas@escolarea.com>
Date: Wed, 29 Dec 2010 16:34:48 -0600
Subject: [PATCH] fixed pdf upload in docs service
---
src/gdata/docs/service.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gdata/docs/service.py b/gdata/docs/service.py
index 9dd1f21..14c6e7d 100644
--- a/src/gdata/docs/service.py
+++ b/src/gdata/docs/service.py
@@ -149,14 +149,16 @@ class DocsService(gdata.service.GDataService):
except AttributeError:
uri = folder_or_uri
else:
- uri = '/feeds/documents/private/full'
+ uri = '/feeds/default/private/full'
+
+ uri = uri.replace('folders', 'default') + '/contents' if not 'contents' in uri else uri
entry = gdata.docs.DocumentListEntry()
entry.title = atom.Title(text=title)
if category is not None:
entry.category.append(category)
entry = self.Post(entry, uri, media_source=media_source,
- extra_headers={'Slug': media_source.file_name},
+ extra_headers={'Slug': media_source.file_name, 'GData-Version': 3},
converter=gdata.docs.DocumentListEntryFromString)
return entry
--
1.7.0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment