当前位置: 首页>>代码示例>>Python>>正文


Python SNSLog.info方法代码示例

本文整理汇总了Python中snsapi.snslog.SNSLog.info方法的典型用法代码示例。如果您正苦于以下问题:Python SNSLog.info方法的具体用法?Python SNSLog.info怎么用?Python SNSLog.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在snsapi.snslog.SNSLog的用法示例。


在下文中一共展示了SNSLog.info方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: input

# 需要导入模块: from snsapi.snslog import SNSLog [as 别名]
# 或者: from snsapi.snslog.SNSLog import info [as 别名]
 def input(self, ml):
     count = 0 
     for m in ml:
         if self._inqueue(m):
             count += 1
     logger.info("Input %d new message", count)
     self.log("Input %d new message" % count)
开发者ID:changguanghua,项目名称:sina-automator,代码行数:9,代码来源:queue.py

示例2: load_weight

# 需要导入模块: from snsapi.snslog import SNSLog [as 别名]
# 或者: from snsapi.snslog.SNSLog import info [as 别名]
 def load_weight(self, fn = None):
     if fn is None:
         fn = 'conf/weights.json'
     try:
         self.feature_weight = json.loads(open(fn, 'r').read())
         self.feature_name = self.feature_weight.keys()
         logger.info("Loaded weights: %s", self.feature_weight)
     except IOError:
         logger.warning("No '%s' weights config file, use empty setting.", fn)
         self.feature_weight = {}
         self.feature_name = self.feature_weight.keys()
开发者ID:Kelvin-Zhong,项目名称:sns-router,代码行数:13,代码来源:score.py

示例3: input

# 需要导入模块: from snsapi.snslog import SNSLog [as 别名]
# 或者: from snsapi.snslog.SNSLog import info [as 别名]
    def input(self, channel = None):
        if channel:
            ml = self._home_timeline(channel)
        else:
            ml = snstype.MessageList()
            for chn in self.sp:
                ml.extend(self._home_timeline(chn))

        count = 0 
        for m in ml:
            if self._inqueue(m):
                count += 1
        logger.info("Input %d new message", count)
        self.log("Input %d new message" % count)
开发者ID:fqj1994,项目名称:sns-router,代码行数:16,代码来源:queue.py

示例4: reweight_all

# 需要导入模块: from snsapi.snslog import SNSLog [as 别名]
# 或者: from snsapi.snslog.SNSLog import info [as 别名]
    def reweight_all(self, younger_than = 86400):
        begin = self.time()
        cur = self.con.cursor()
        try:
            latest_time = int(self.time() - younger_than)
            r = cur.execute('''
            SELECT id from msg
            WHERE time >= ?
            ''', (latest_time, ))
            for m in r:
                self.reweight(m[0])
        except Exception, e:
            logger.warning("Catch exception: %s", e)
            return False
        end = self.time()
        logger.info("Reweight done. Time elapsed: %.2f", end - begin)
        return True

    def _dump2pickle(self, fn_pickle):
        # dump all to pickle format
        cur = self.con.cursor()
        r = cur.execute('''
        SELECT id,time,userid,username,text,pyobj,flag FROM msg  
        ''')
        message_list = snstype.MessageList()
        for m in r:
            obj = self._str2pyobj(m[5])
            obj.msg_id = m[0]
            obj.flag = m[6]
            message_list.append(obj)
        r = cur.execute('''
开发者ID:wcyz666,项目名称:snsrouter-modified,代码行数:33,代码来源:srfequeue.py

示例5: load_config

# 需要导入模块: from snsapi.snslog import SNSLog [as 别名]
# 或者: from snsapi.snslog.SNSLog import info [as 别名]
   * lc = load_config
   * sc = save_config
   * lsc = list_channel
   * lsp = list_platform
   * newc = new_channel
   * addc = add_channel
   * clc = clear_channel
   * auth = auth
   * ht = home_timeline
   * up = update
   * re = reply
   * fwd = forward
   * lk = like
   * ulk = unlike
   
Tutorial of SNSCLI:

   * https://github.com/hupili/snsapi/wiki/Tutorial-of-snscli
"""

if __name__ == '__main__':
    #==== default initialization one may like ====
    print helpdoc
    load_config()
    list_channel()
    auth()

    logger.info("Ready to drop into the interactive shell of SNSCLI!")
    import code
    code.interact(local=locals())
开发者ID:huiliang,项目名称:snsapi,代码行数:32,代码来源:snscli.py


注:本文中的snsapi.snslog.SNSLog.info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。