<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import atom <EOL> import gdata <EOL> import re <EOL> LABEL_SCHEME = '<STR_LIT>' <EOL> THR_NAMESPACE = '<STR_LIT>' <EOL> class BloggerEntry ( gdata . GDataEntry ) : <EOL> """<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> def GetBlogId ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . id . text : <EOL> match = self . blog_id_pattern . match ( self . id . text ) <EOL> if match : <EOL> return match . group ( <NUM_LIT:2> ) <EOL> else : <EOL> return self . blog_id2_pattern . match ( self . id . text ) . group ( <NUM_LIT:2> ) <EOL> return None <EOL> def GetBlogName ( self ) : <EOL> """<STR_LIT>""" <EOL> for link in self . link : <EOL> if link . rel == '<STR_LIT>' : <EOL> return self . blog_name_pattern . match ( link . href ) . group ( <NUM_LIT:2> ) <EOL> return None <EOL> class BlogEntry ( BloggerEntry ) : <EOL> """<STR_LIT>""" <EOL> def BlogEntryFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( BlogEntry , xml_string ) <EOL> class BlogFeed ( gdata . GDataFeed ) : <EOL> """<STR_LIT>""" <EOL> _children = gdata . GDataFeed . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % atom . ATOM_NAMESPACE ] = ( '<STR_LIT>' , [ BlogEntry ] ) <EOL> def BlogFeedFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( BlogFeed , xml_string ) <EOL> class BlogPostEntry ( BloggerEntry ) : <EOL> """<STR_LIT>""" <EOL> post_id_pattern = re . compile ( '<STR_LIT>' ) <EOL> def AddLabel ( self , label ) : <EOL> """<STR_LIT>""" <EOL> self . category . append ( atom . Category ( scheme = LABEL_SCHEME , term = label ) ) <EOL> def GetPostId ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . id . text : <EOL> return self . post_id_pattern . match ( self . id . text ) . group ( <NUM_LIT:4> ) <EOL> return None <EOL> def BlogPostEntryFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( BlogPostEntry , xml_string ) <EOL> class BlogPostFeed ( gdata . GDataFeed ) : <EOL> """<STR_LIT>""" <EOL> _children = gdata . GDataFeed . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % atom . ATOM_NAMESPACE ] = ( '<STR_LIT>' , [ BlogPostEntry ] ) <EOL> def BlogPostFeedFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( BlogPostFeed , xml_string ) <EOL> class InReplyTo ( atom . AtomBase ) : <EOL> _tag = '<STR_LIT>' <EOL> _namespace = THR_NAMESPACE <EOL> _attributes = atom . AtomBase . _attributes . copy ( ) <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT:source>' ] = '<STR_LIT:source>' <EOL> _attributes [ '<STR_LIT:type>' ] = '<STR_LIT:type>' <EOL> def __init__ ( self , href = None , ref = None , source = None , type = None , <EOL> extension_elements = None , extension_attributes = None , text = None ) : <EOL> self . href = href <EOL> self . ref = ref <EOL> self . source = source <EOL> self . type = type <EOL> self . extension_elements = extension_elements or [ ] <EOL> self . extension_attributes = extension_attributes or { } <EOL> self . text = text <EOL> def InReplyToFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( InReplyTo , xml_string ) <EOL> class CommentEntry ( BloggerEntry ) : <EOL> """<STR_LIT>""" <EOL> _children = BloggerEntry . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % THR_NAMESPACE ] = ( '<STR_LIT>' , InReplyTo ) <EOL> comment_id_pattern = re . compile ( '<STR_LIT>' ) <EOL> def __init__ ( self , author = None , category = None , content = None , <EOL> contributor = None , atom_id = None , link = None , published = None , rights = None , <EOL> source = None , summary = None , control = None , title = None , updated = None , <EOL> in_reply_to = None , extension_elements = None , extension_attributes = None , <EOL> text = None ) : <EOL> BloggerEntry . __init__ ( self , author = author , category = category , <EOL> content = content , contributor = contributor , atom_id = atom_id , link = link , <EOL> published = published , rights = rights , source = source , summary = summary , <EOL> control = control , title = title , updated = updated , <EOL> extension_elements = extension_elements , <EOL> extension_attributes = extension_attributes , text = text ) <EOL> self . in_reply_to = in_reply_to <EOL> def GetCommentId ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . id . text : <EOL> return self . comment_id_pattern . match ( self . id . text ) . group ( <NUM_LIT:1> ) <EOL> return None <EOL> def CommentEntryFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( CommentEntry , xml_string ) <EOL> class CommentFeed ( gdata . GDataFeed ) : <EOL> """<STR_LIT>""" <EOL> _children = gdata . GDataFeed . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % atom . ATOM_NAMESPACE ] = ( '<STR_LIT>' , [ CommentEntry ] ) <EOL> def CommentFeedFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( CommentFeed , xml_string ) </s>
