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


Python Log.v方法代码示例

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


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

示例1: queue_tweet

# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import v [as 别名]
 def queue_tweet(self, wrapped_tweet):
     self.tweet_queue.append(wrapped_tweet)
     Log.v("READ", "Added new tweet to queue: ")
     wrapped_tweet.print_incoming_status()
     if not self.thread_locked:
         self.thread_locked = True
         self.thread = threading.Thread(target=self.work_on_tweet)
         self.thread.start();
     else:
         return
开发者ID:NavjotPanesar,项目名称:DogeBot,代码行数:12,代码来源:statusqueue.py

示例2: post_analytic

# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import v [as 别名]
 def post_analytic(tweetWrapper):
     if StatusAnalyticsSender.enabled is False:
         return
     tweet_analytic = tweetWrapper.tweet_analytic
     tweetId = tweet_analytic.new_tweet_id
     username = tweet_analytic.reply_to_username
     command = tweet_analytic.plugin_name
     commandOperands = tweetWrapper.get_tweet_command().get_command_operands()
     timeTaken = tweet_analytic.get_total_time()
     payload = {'token': analytics_auth_token, 'tweetId': tweetId, 'username' : username, 'command': command,'commandOperands': commandOperands, 'timeTaken': timeTaken}
     print payload
     r = requests.post(analytics_url, data=payload)
     Log.v("[ANALYTICS]", r.text)
开发者ID:NavjotPanesar,项目名称:DogeBot,代码行数:15,代码来源:statusanalytics.py

示例3: work_on_tweet

# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import v [as 别名]
 def work_on_tweet(self):
     if not self.tweet_queue:
         self.thread_locked = False
         return
     else:
         wrapped_tweet = self.tweet_queue[0]
         del self.tweet_queue[0]
         Log.v("QUEUE", 'doing work on tweet: ')
         wrapped_tweet.print_incoming_status()
         try:
             self.notify_add_on_status_ready_listeners(wrapped_tweet)
         except Exception as e:
             Log.report_exception(e, traceback)
         Log.v("QUEUE", 'finished work on tweet: ')
         wrapped_tweet.print_incoming_status()
         self.work_on_tweet()
开发者ID:NavjotPanesar,项目名称:DogeBot,代码行数:18,代码来源:statusqueue.py

示例4: update_status

# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import v [as 别名]
 def update_status(self, tweet_response):
     if(tweet_response.get_is_image_tweet()):
         if tweet_response.get_image():
             Log.v("SEND","with image: " + Log.sanitizeOuput(tweet_response.get_status()) )
             return self.api.update_with_media("resources/doge.jpg", tweet_response.get_status(), in_reply_to_status_id=tweet_response.get_reply_to_id(), file=tweet_response.get_image())
         elif tweet_response.get_image_loc():
             Log.v("SEND","with image: " + Log.sanitizeOuput(tweet_response.get_status()) )
             return self.api.update_with_media(tweet_response.get_image_loc(), tweet_response.get_status(), in_reply_to_status_id=tweet_response.get_reply_to_id())
     else:
         Log.v("SEND", Log.sanitizeOuput(tweet_response.get_status()) )
         return self.api.update_status(tweet_response.get_status(), tweet_response.get_reply_to_id())
开发者ID:NavjotPanesar,项目名称:DogeBot,代码行数:13,代码来源:tweetsender.py

示例5: on_status

# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import v [as 别名]
 def on_status(self, status):
     Log.v("TIMELINE SCANNER", "New tweet: ")
     Log.v("TWEET", status)
     wrapped_tweet = TweetWrapper()
     wrapped_tweet.set_incoming_status(status)
     self.notify_new_status(wrapped_tweet)
开发者ID:NavjotPanesar,项目名称:DogeBot,代码行数:8,代码来源:timelinescanner.py

示例6: print_tweet_response

# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import v [as 别名]
 def print_tweet_response(self):
     Log.v("ANALYZER","response received: " + Log.sanitizeOuput(self._tweet_response))
开发者ID:NavjotPanesar,项目名称:DogeBot,代码行数:4,代码来源:tweetwrapper.py

示例7: print_incoming_status

# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import v [as 别名]
 def print_incoming_status(self):
     Log.v("TWEET", self._status_incoming)
开发者ID:NavjotPanesar,项目名称:DogeBot,代码行数:4,代码来源:tweetwrapper.py

示例8: setUp

# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import v [as 别名]
 def setUp(self):
     self.response = []
     Log.showV = False
     Log.notifyMe = False
     StatusAnalyticsSender.enabled = False
     Log.v("TEST", "NEW TEST---------------------------------------")
开发者ID:NavjotPanesar,项目名称:DogeBot,代码行数:8,代码来源:UnitTests.py

示例9: TimelineScanner

# 需要导入模块: from logger import Log [as 别名]
# 或者: from logger.Log import v [as 别名]
from config import *
from logger import Log
from components.statusqueue import StatusQueue
from components.timelinescanner import TimelineScanner
from components.tweetsender import TweetSender
from components.statusanalyzer import StatusAnalyzer
import json


if __name__ == '__main__':
    auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
    auth.set_access_token(access_token_key, access_token_secret)
    api = tweepy.API(auth)

    timeline_scanner = TimelineScanner(api)
    status_queue = StatusQueue()
    status_analyzer = StatusAnalyzer()
    tweet_sender = TweetSender(api)

    timeline_scanner.add_new_status_listener(status_queue.queue_tweet) #once scanner finds a tweet, pass it to the reader
    status_queue.add_status_ready_listener(status_analyzer.generate_response_tweet)
    status_analyzer.add_response_generated_listener(tweet_sender.send_tweet)

    Log.v("MAIN", "Initialized scanner")

    stream = tweepy.Stream(auth, timeline_scanner)
    stream.filter(track=['dogebot'])
    #I want to listen in onto #dogebot first, then from there detect commands. If you want to just listen into all commands, do:
    #stream.filter(track=plugin_classes.get_commands_list())

开发者ID:NavjotPanesar,项目名称:DogeBot,代码行数:31,代码来源:__main__.py


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