Esempio n. 1
0
 def add(self):
     """收听某个用户"""
     assertion(not bool(self.self), "you can't follow your self")
     if self.ismyidol:
         return  # already flollowed
     else:
         self._api.friends.add(name=self.name)
Esempio n. 2
0
 def delete(self):
     """取消收听某个用户"""
     assertion(not bool(self.self), "you can't unfollow your self")
     if self.ismyidol:
         self._api.friends.delete(name=self.name)
     else:
         pass
Esempio n. 3
0
 def delete(self):
     """取消收听某个用户"""
     assertion(not bool(self.self), "you can't unfollow your self")
     if self.ismyidol:
         self._api.friends.delete(name=self.name)
     else:
         pass
Esempio n. 4
0
 def add(self):
     """收听某个用户"""
     assertion(not bool(self.self), "you can't follow your self")
     if self.ismyidol:
         return                      # already flollowed
     else:
         self._api.friends.add(name=self.name)
Esempio n. 5
0
    def update(self, **kwargs):
        assertion(self.self, "you can only update youself's profile")

        nick = self.nick = kwargs.get('nick', self.nick)
        sex = self.sex = kwargs.get('sex', self.sex)
        year = self.birthyear = kwargs.get('year', self.birthyear)
        month = self.birthmonth = kwargs.get('month', self.birthmonth)
        day = self.birthday = kwargs.get('day', self.birthday)
        countrycode = self.countrycode = kwargs.get('countrycode',
                                                    self.countrycode)
        provincecode = self.provincecode = kwargs.get('provincecode',
                                                      self.provincecode)
        citycode = self.citycode = kwargs.get('citycode', self.citycode)
        introduction = self.introduction = kwargs.get('introduction',
                                                      self.introduction)
        self._api.user.update(nick, sex, year, month, day, countrycode,
                              provincecode, citycode, introduction)
Esempio n. 6
0
    def update(self, **kwargs):
        assertion(self.self, "you can only update youself's profile")

        nick = self.nick = kwargs.get('nick', self.nick)
        sex = self.sex = kwargs.get('sex', self.sex)
        year = self.birthyear = kwargs.get('year', self.birthyear)
        month = self.birthmonth = kwargs.get('month', self.birthmonth)
        day = self.birthday = kwargs.get('day', self.birthday)
        countrycode = self.countrycode = kwargs.get('countrycode',
                                                    self.countrycode)
        provincecode = self.provincecode = kwargs.get('provincecode',
                                                      self.provincecode)
        citycode = self.citycode = kwargs.get('citycode', self.citycode)
        introduction = self.introduction = kwargs.get('introduction',
                                                      self.introduction)
        self._api.user.update(nick, sex, year, month, day, countrycode,
                              provincecode, citycode, introduction)
Esempio n. 7
0
 def headimg(self, size=100):
     assertion(size in [20, 30, 40, 50, 100],
               'size must be one of 20 30 40 50 100')
     return '%s/%s' % (self.head, size)
Esempio n. 8
0
 def pm(self, content, clientip='127.0.0.1', jing=None, wei=None):
     """发私信"""
     assertion(not bool(self.self), "you can't pm yourself")
     return self._api.private.add(self.name, content, clientip, jing, wei)
Esempio n. 9
0
 def deleteblacklist(self):
     """从黑名单中删除某个用户"""
     assertion(not bool(self.self), "you can't block yourself")
     self._api.friends.deleteblacklist(name=self.name)
Esempio n. 10
0
 def addblacklist(self):
     """添加某个用户到黑名单"""
     assertion(not bool(self.self), "you can't block yourself")
     self._api.friends.addblacklist(name=self.name)
Esempio n. 11
0
 def deletespecial(self):
     """取消特别收听某个用户"""
     assertion(not bool(self.self), "you can't follow yourself")
     self._api.friends.deletespecial(name=self.name)
Esempio n. 12
0
 def headimg(self, size=100):
     assertion(size in [20, 30, 40, 50, 100],
               'size must be one of 20 30 40 50 100')
     return '%s/%s' % (self.head, size)
Esempio n. 13
0
 def pm(self, content, clientip='127.0.0.1', jing=None, wei=None):
     """发私信"""
     assertion(not bool(self.self), "you can't pm yourself")
     return self._api.private.add(self.name, content, clientip, jing, wei)
Esempio n. 14
0
 def deleteblacklist(self):
     """从黑名单中删除某个用户"""
     assertion(not bool(self.self), "you can't block yourself")
     self._api.friends.deleteblacklist(name=self.name)
Esempio n. 15
0
 def addblacklist(self):
     """添加某个用户到黑名单"""
     assertion(not bool(self.self), "you can't block yourself")
     self._api.friends.addblacklist(name=self.name)
Esempio n. 16
0
 def deletespecial(self):
     """取消特别收听某个用户"""
     assertion(not bool(self.self), "you can't follow yourself")
     self._api.friends.deletespecial(name=self.name)