Commits

Yu-Jie Lin  committed 6d19aeb

add Blogger page support. close #1

  • Participants
  • Parent commits d60ab75

Comments (0)

Files changed (3)

   * add ``doc`` for documentation generation
   * add ``upload_doc`` for uploading to PyPI
   * add ``clean`` for cleaning up built files
+* add Blogger page support (#1)
 
 Version 0.6.2 (2013-08-18T11:51:37Z)
 ====================================

File bpy/services/blogger.py

 
     if kind == 'post':
       posts = self.service.posts()
+    elif kind == 'page':
+      posts = self.service.pages()
     else:
       raise ValueError('Unsupported kind: %s' % kind)
 
     if 'id' in post:
       print('Updating a %s: %s' % (kind, title))
-      req = posts.update(blogId=post['blog']['id'], postId=post['id'],
-                         body=post)
+      data = {
+        'blogId': post['blog']['id'],
+        'body': post,
+        '%sId' % kind: post['id'],
+      }
+      req = posts.update(**data)
     else:
       print('Posting a new %s: %s' % (kind, title))
       req = posts.insert(blogId=post['blog']['id'], body=post)

File docs/header.rst

 ``kind``:
   type of the posting, ``post`` or ``page``, default is ``post``.
   
-  Blogger service currently only supports ``post``.
-
   It could be added automatically after successfully posting.
 
 ``labels``: