示例#1
0
    def __init__(self, d):
        status = dict(d)
        self.data = status
        
        if "delete" in status: return
        
        self.created_at = twittertime(status["created_at"])
        
        for i in ("id", "in_reply_to_status_id",
                  "in_reply_to_user_id"):
            setattr(self, i, int(status[i]) \
                        if status[i] != None else None)
        
        for i in ("text", "source", "in_reply_to_screen_name"):
            setattr(self, i, unicode(status[i]) \
                        if status[i] != None else None)
        
        self.source_name = twittersource(self.source)
        
        for i in ("favorited", "truncated"):
            setattr(self, i, status[i])
        
        if "user" in status.keys():
            self.user = user.twuser(status["user"])

        if "retweeted_status" in status.keys():
            self.retweeted_status = twstatus(status["retweeted_status"])
        else:
            self.retweeted_status = None
示例#2
0
 def source_name(self):
     return twittersource(self.get("source"))
示例#3
0
 def source_name(self): return twittersource(self.get("source"))
 @property