<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import gdata . service <EOL> import gdata . blogger <EOL> class BloggerService ( gdata . service . GDataService ) : <EOL> def __init__ ( self , email = None , password = None , source = None , <EOL> server = None , api_key = None , <EOL> additional_headers = None ) : <EOL> gdata . service . GDataService . __init__ ( self , email = email , password = password , <EOL> service = '<STR_LIT>' , source = source , <EOL> server = server , <EOL> additional_headers = additional_headers ) <EOL> self . accountType = '<STR_LIT>' <EOL> def GetBlogFeed ( self , uri = None ) : <EOL> """<STR_LIT>""" <EOL> if not uri : <EOL> uri = '<STR_LIT>' <EOL> return self . Get ( uri , converter = gdata . blogger . BlogFeedFromString ) <EOL> def GetBlogCommentFeed ( self , blog_id = None , uri = None ) : <EOL> """<STR_LIT>""" <EOL> if blog_id : <EOL> uri = '<STR_LIT>' % blog_id <EOL> return self . Get ( uri , converter = gdata . blogger . CommentFeedFromString ) <EOL> def GetBlogPostFeed ( self , blog_id = None , uri = None ) : <EOL> if blog_id : <EOL> uri = '<STR_LIT>' % blog_id <EOL> return self . Get ( uri , converter = gdata . blogger . BlogPostFeedFromString ) <EOL> def GetPostCommentFeed ( self , blog_id = None , post_id = None , uri = None ) : <EOL> """<STR_LIT>""" <EOL> if blog_id and post_id : <EOL> uri = '<STR_LIT>' % ( blog_id , <EOL> post_id ) <EOL> return self . Get ( uri , converter = gdata . blogger . CommentFeedFromString ) <EOL> def AddPost ( self , entry , blog_id = None , uri = None ) : <EOL> if blog_id : <EOL> uri = '<STR_LIT>' % blog_id <EOL> return self . Post ( entry , uri , <EOL> converter = gdata . blogger . BlogPostEntryFromString ) <EOL> def UpdatePost ( self , entry , uri = None ) : <EOL> if not uri : <EOL> uri = entry . GetEditLink ( ) . href <EOL> return self . Put ( entry , uri , <EOL> converter = gdata . blogger . BlogPostEntryFromString ) <EOL> def DeletePost ( self , entry = None , uri = None ) : <EOL> if not uri : <EOL> uri = entry . GetEditLink ( ) . href <EOL> return self . Delete ( uri ) <EOL> def AddComment ( self , comment_entry , blog_id = None , post_id = None , uri = None ) : <EOL> """<STR_LIT>""" <EOL> if blog_id and post_id : <EOL> uri = '<STR_LIT>' % ( <EOL> blog_id , post_id ) <EOL> return self . Post ( comment_entry , uri , <EOL> converter = gdata . blogger . CommentEntryFromString ) <EOL> def DeleteComment ( self , entry = None , uri = None ) : <EOL> if not uri : <EOL> uri = entry . GetEditLink ( ) . href <EOL> return self . Delete ( uri ) <EOL> class BlogQuery ( gdata . service . Query ) : <EOL> def __init__ ( self , feed = None , params = None , categories = None , blog_id = None ) : <EOL> """<STR_LIT>""" <EOL> if not feed and blog_id : <EOL> feed = '<STR_LIT>' % blog_id <EOL> elif not feed : <EOL> feed = '<STR_LIT>' <EOL> gdata . service . Query . __init__ ( self , feed = feed , params = params , <EOL> categories = categories ) <EOL> class BlogPostQuery ( gdata . service . Query ) : <EOL> def __init__ ( self , feed = None , params = None , categories = None , blog_id = None , <EOL> post_id = None ) : <EOL> if not feed and blog_id and post_id : <EOL> feed = '<STR_LIT>' % ( blog_id , <EOL> post_id ) <EOL> elif not feed and blog_id : <EOL> feed = '<STR_LIT>' % blog_id <EOL> gdata . service . Query . __init__ ( self , feed = feed , params = params , <EOL> categories = categories ) <EOL> class BlogCommentQuery ( gdata . service . Query ) : <EOL> def __init__ ( self , feed = None , params = None , categories = None , blog_id = None , <EOL> post_id = None , comment_id = None ) : <EOL> if not feed and blog_id and comment_id : <EOL> feed = '<STR_LIT>' % ( <EOL> blog_id , comment_id ) <EOL> elif not feed and blog_id and post_id : <EOL> feed = '<STR_LIT>' % ( <EOL> blog_id , post_id ) <EOL> elif not feed and blog_id : <EOL> feed = '<STR_LIT>' % blog_id <EOL> gdata . service . Query . __init__ ( self , feed = feed , params = params , <EOL> categories = categories ) </s>
