<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import re <EOL> import urllib . parse <EOL> import atom . core <EOL> import gdata . data <EOL> LABEL_SCHEME = '<STR_LIT>' <EOL> THR_TEMPLATE = '<STR_LIT>' <EOL> BLOG_NAME_PATTERN = re . compile ( '<STR_LIT>' ) <EOL> BLOG_ID_PATTERN = re . compile ( '<STR_LIT>' ) <EOL> BLOG_ID2_PATTERN = re . compile ( '<STR_LIT>' ) <EOL> POST_ID_PATTERN = re . compile ( <EOL> '<STR_LIT>' ) <EOL> PAGE_ID_PATTERN = re . compile ( <EOL> '<STR_LIT>' ) <EOL> COMMENT_ID_PATTERN = re . compile ( '<STR_LIT>' ) <EOL> class BloggerEntry ( gdata . data . GDEntry ) : <EOL> """<STR_LIT>""" <EOL> def get_blog_id ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . id . text : <EOL> match = BLOG_ID_PATTERN . match ( self . id . text ) <EOL> if match : <EOL> return match . group ( <NUM_LIT:2> ) <EOL> else : <EOL> return BLOG_ID2_PATTERN . match ( self . id . text ) . group ( <NUM_LIT:2> ) <EOL> return None <EOL> GetBlogId = get_blog_id <EOL> def get_blog_name ( self ) : <EOL> """<STR_LIT>""" <EOL> for link in self . link : <EOL> if link . rel == '<STR_LIT>' : <EOL> return urllib . parse . urlparse ( link . href ) [ <NUM_LIT:1> ] . split ( "<STR_LIT:.>" , <NUM_LIT:1> ) [ <NUM_LIT:0> ] <EOL> return None <EOL> GetBlogName = get_blog_name <EOL> class Blog ( BloggerEntry ) : <EOL> """<STR_LIT>""" <EOL> class BlogFeed ( gdata . data . GDFeed ) : <EOL> entry = [ Blog ] <EOL> class BlogPost ( BloggerEntry ) : <EOL> """<STR_LIT>""" <EOL> def add_label ( self , label ) : <EOL> """<STR_LIT>""" <EOL> self . category . append ( atom . data . Category ( scheme = LABEL_SCHEME , term = label ) ) <EOL> AddLabel = add_label <EOL> def get_post_id ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . id . text : <EOL> return POST_ID_PATTERN . match ( self . id . text ) . group ( <NUM_LIT:4> ) <EOL> return None <EOL> GetPostId = get_post_id <EOL> class BlogPostFeed ( gdata . data . GDFeed ) : <EOL> entry = [ BlogPost ] <EOL> class BlogPage ( BloggerEntry ) : <EOL> """<STR_LIT>""" <EOL> def get_page_id ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . id . text : <EOL> return PAGE_ID_PATTERN . match ( self . id . text ) . group ( <NUM_LIT:4> ) <EOL> return None <EOL> GetPageId = get_page_id <EOL> class BlogPageFeed ( gdata . data . GDFeed ) : <EOL> entry = [ BlogPage ] <EOL> class InReplyTo ( atom . core . XmlElement ) : <EOL> _qname = THR_TEMPLATE % '<STR_LIT>' <EOL> href = '<STR_LIT>' <EOL> ref = '<STR_LIT>' <EOL> source = '<STR_LIT:source>' <EOL> type = '<STR_LIT:type>' <EOL> class Comment ( BloggerEntry ) : <EOL> """<STR_LIT>""" <EOL> in_reply_to = InReplyTo <EOL> def get_comment_id ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . id . text : <EOL> return COMMENT_ID_PATTERN . match ( self . id . text ) . group ( <NUM_LIT:1> ) <EOL> return None <EOL> GetCommentId = get_comment_id <EOL> class CommentFeed ( gdata . data . GDFeed ) : <EOL> entry = [ Comment ] </s>
