<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import gdata . client <EOL> import gdata . gauth <EOL> import gdata . blogger . data <EOL> import atom . data <EOL> import atom . http_core <EOL> BLOGS_URL = '<STR_LIT>' <EOL> BLOG_POST_URL = '<STR_LIT>' <EOL> BLOG_PAGE_URL = '<STR_LIT>' <EOL> BLOG_POST_COMMENTS_URL = '<STR_LIT>' <EOL> BLOG_COMMENTS_URL = '<STR_LIT>' <EOL> BLOG_ARCHIVE_URL = '<STR_LIT>' <EOL> class BloggerClient ( gdata . client . GDClient ) : <EOL> api_version = '<STR_LIT:2>' <EOL> auth_service = '<STR_LIT>' <EOL> auth_scopes = gdata . gauth . AUTH_SCOPES [ '<STR_LIT>' ] <EOL> def get_blogs ( self , user_id = '<STR_LIT:default>' , auth_token = None , <EOL> desired_class = gdata . blogger . data . BlogFeed , ** kwargs ) : <EOL> return self . get_feed ( BLOGS_URL % user_id , auth_token = auth_token , <EOL> desired_class = desired_class , ** kwargs ) <EOL> GetBlogs = get_blogs <EOL> def get_posts ( self , blog_id , auth_token = None , <EOL> desired_class = gdata . blogger . data . BlogPostFeed , query = None , <EOL> ** kwargs ) : <EOL> return self . get_feed ( BLOG_POST_URL % blog_id , auth_token = auth_token , <EOL> desired_class = desired_class , query = query , ** kwargs ) <EOL> GetPosts = get_posts <EOL> def get_pages ( self , blog_id , auth_token = None , <EOL> desired_class = gdata . blogger . data . BlogPageFeed , query = None , <EOL> ** kwargs ) : <EOL> return self . get_feed ( BLOG_PAGE_URL % blog_id , auth_token = auth_token , <EOL> desired_class = desired_class , query = query , ** kwargs ) <EOL> GetPages = get_pages <EOL> def get_post_comments ( self , blog_id , post_id , auth_token = None , <EOL> desired_class = gdata . blogger . data . CommentFeed , <EOL> query = None , ** kwargs ) : <EOL> return self . get_feed ( BLOG_POST_COMMENTS_URL % ( blog_id , post_id ) , <EOL> auth_token = auth_token , desired_class = desired_class , <EOL> query = query , ** kwargs ) <EOL> GetPostComments = get_post_comments <EOL> def get_blog_comments ( self , blog_id , auth_token = None , <EOL> desired_class = gdata . blogger . data . CommentFeed , <EOL> query = None , ** kwargs ) : <EOL> return self . get_feed ( BLOG_COMMENTS_URL % blog_id , auth_token = auth_token , <EOL> desired_class = desired_class , query = query , ** kwargs ) <EOL> GetBlogComments = get_blog_comments <EOL> def get_blog_archive ( self , blog_id , auth_token = None , ** kwargs ) : <EOL> return self . get_feed ( BLOG_ARCHIVE_URL % blog_id , auth_token = auth_token , <EOL> ** kwargs ) <EOL> GetBlogArchive = get_blog_archive <EOL> def add_post ( self , blog_id , title , body , labels = None , draft = False , <EOL> auth_token = None , title_type = '<STR_LIT:text>' , body_type = '<STR_LIT:html>' , ** kwargs ) : <EOL> new_entry = gdata . blogger . data . BlogPost ( <EOL> title = atom . data . Title ( text = title , type = title_type ) , <EOL> content = atom . data . Content ( text = body , type = body_type ) ) <EOL> if labels : <EOL> for label in labels : <EOL> new_entry . add_label ( label ) <EOL> if draft : <EOL> new_entry . control = atom . data . Control ( draft = atom . data . Draft ( text = '<STR_LIT:yes>' ) ) <EOL> return self . post ( new_entry , BLOG_POST_URL % blog_id , auth_token = auth_token , ** kwargs ) <EOL> AddPost = add_post <EOL> def add_page ( self , blog_id , title , body , draft = False , auth_token = None , <EOL> title_type = '<STR_LIT:text>' , body_type = '<STR_LIT:html>' , ** kwargs ) : <EOL> new_entry = gdata . blogger . data . BlogPage ( <EOL> title = atom . data . Title ( text = title , type = title_type ) , <EOL> content = atom . data . Content ( text = body , type = body_type ) ) <EOL> if draft : <EOL> new_entry . control = atom . data . Control ( draft = atom . data . Draft ( text = '<STR_LIT:yes>' ) ) <EOL> return self . post ( new_entry , BLOG_PAGE_URL % blog_id , auth_token = auth_token , ** kwargs ) <EOL> AddPage = add_page <EOL> def add_comment ( self , blog_id , post_id , body , auth_token = None , <EOL> title_type = '<STR_LIT:text>' , body_type = '<STR_LIT:html>' , ** kwargs ) : <EOL> new_entry = gdata . blogger . data . Comment ( <EOL> content = atom . data . Content ( text = body , type = body_type ) ) <EOL> return self . post ( new_entry , BLOG_POST_COMMENTS_URL % ( blog_id , post_id ) , <EOL> auth_token = auth_token , ** kwargs ) <EOL> AddComment = add_comment <EOL> def update ( self , entry , auth_token = None , ** kwargs ) : <EOL> old_etag = entry . etag <EOL> entry . etag = None <EOL> response = gdata . client . GDClient . update ( self , entry , <EOL> auth_token = auth_token , ** kwargs ) <EOL> entry . etag = old_etag <EOL> return response <EOL> Update = update <EOL> def delete ( self , entry_or_uri , auth_token = None , ** kwargs ) : <EOL> if isinstance ( entry_or_uri , ( str , unicode , atom . http_core . Uri ) ) : <EOL> return gdata . client . GDClient . delete ( self , entry_or_uri , <EOL> auth_token = auth_token , ** kwargs ) <EOL> old_etag = entry_or_uri . etag <EOL> entry_or_uri . etag = None <EOL> response = gdata . client . GDClient . delete ( self , entry_or_uri , <EOL> auth_token = auth_token , ** kwargs ) <EOL> entry_or_uri . etag = old_etag <EOL> return response <EOL> Delete = delete <EOL> class Query ( gdata . client . Query ) : <EOL> def __init__ ( self , order_by = None , ** kwargs ) : <EOL> gdata . client . Query . __init__ ( self , ** kwargs ) <EOL> self . order_by = order_by <EOL> def modify_request ( self , http_request ) : <EOL> gdata . client . _add_query_param ( '<STR_LIT>' , self . order_by , http_request ) <EOL> gdata . client . Query . modify_request ( self , http_request ) <EOL> ModifyRequest = modify_request </s>
