def __str__(self): #result = 'Plurk(%d): %s\n' % (self.id, self._data) result = 'Plurk(%d)%s - %s:\n %s\n' % ( self.id, tool.datetime_from_plurk_string( self._data['posted'] ), self._data['owner_id'] , self._data['content_raw'] ) #result = [ self.id, self._data['posted'], self._data['owner_id'] ,self._data['content_raw'] ] return result.encode('utf8')
def __init__(self, plurk_json_list, user_json_list=[] , CtlDate = False , Date = date.today() ): self.plurks = [] #print plurk_json_list #print Date if CtlDate == True: for x in plurk_json_list: #print x if Date == tool.datetime_from_plurk_string( x['posted'] ).date() : self.plurks.append( PlurkPlurk( x ) ) else: for x in plurk_json_list: self.plurks.append( PlurkPlurk( x ) ) for x in user_json_list: self.users = PlurkUser( x )
def __init__(self, PersionInfo): self.__dict__.update(PersionInfo) if self.__dict__.has_key('posted') and type(self.posted) == str: self.posted = tool.datetime_from_plurk_string(self.posted)