#NEWLINE# def create_from_gplus_post( self , gplus_post ) : #NEWLINE# #INDENT# self . post_id = gplus_post [ 'id' ] #NEWLINE# self . name = gplus_post [ 'actor' ] [ 'displayName' ] #NEWLINE# self . gplus_id = gplus_post [ 'actor' ] [ 'id' ] #NEWLINE# self . date = gplus_post [ 'updated' ] #NEWLINE# self . url = gplus_post [ 'url' ] #NEWLINE# self . title = gplus_post [ 'title' ] #NEWLINE# self . plus_oners = gplus_post [ 'object' ] [ 'plusoners' ] [ 'totalItems' ] #NEWLINE# self . resharers = gplus_post [ 'object' ] [ 'resharers' ] [ 'totalItems' ] #NEWLINE# self . comments = gplus_post [ 'object' ] [ 'replies' ] [ 'totalItems' ] #NEWLINE# content = gplus_post [ 'object' ] [ 'content' ] #NEWLINE# if ( 'annotation' in gplus_post ) : #NEWLINE# #INDENT# content += ( ' ' + gplus_post [ 'annotation' ] ) #NEWLINE# #UNINDENT# self . activity_type = self . get_activity_types ( content ) #NEWLINE# self . product_group = self . get_product_groups ( content ) #NEWLINE# try : #NEWLINE# #INDENT# attachments = gplus_post [ 'object' ] [ 'attachments' ] #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# logging . info ( 'no attachments' ) #NEWLINE# self . links = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# attachment_links = self . get_links ( attachments ) #NEWLINE# self . links = attachment_links