def display_tracking_interval(): # get current time # nowdatetime = weibo_module.get_current_chinatime() timelapsed = -1 # when was the last time we checked most_recent_check = weibo_module.get_most_recent_check() if most_recent_check == -1: print "Never been tracked!" else: # okay, so has it been long enough? timelapsed = nowdatetime - most_recent_check print "It's been " + weibo_module.minsec(timelapsed.seconds) + " min since our most recent check, which was on" , most_recent_check print "We're checking posts every " + weibo_module.minsec(weibo_module.tracking_period_seconds) + " minutes."
def display_tracking_interval(): # get current time # nowdatetime = weibo_module.get_current_chinatime() timelapsed = -1 # when was the last time we checked most_recent_check = weibo_module.get_most_recent_check() if most_recent_check == -1: print "Never been tracked!" else: # okay, so has it been long enough? timelapsed = nowdatetime - most_recent_check print "It's been " + weibo_module.minsec( timelapsed.seconds ) + " min since our most recent check, which was on", most_recent_check print "We're checking posts every " + weibo_module.minsec( weibo_module.tracking_period_seconds) + " minutes."
########################################## ## HAS ENOUGH TIME PASSED? ########################################## # get current time nowdatetime = weibo_module.get_current_chinatime() timelapsed = -1 # when was the last time we checked most_recent_check = weibo_module.get_most_recent_checktime() # okay, so has it been long enough? timelapsed = nowdatetime - most_recent_check print "It's been " + weibo_module.minsec( weibo_module.total_seconds(timelapsed) ) + " min since our most recent check, which was on", most_recent_check if (weibo_module.total_seconds(timelapsed) < weibo_settings.tracking_period_seconds): #not enough time has passed, too bad! print "... But we're checking posts every " + weibo_module.minsec( weibo_settings.tracking_period_seconds) + " minutes!" print "We'll check next time." sys.exit(0) # never been tracked! so let's just go ahead print "Let's start tracking!" print "=====================" ##########################################
########################################## ## HAS ENOUGH TIME PASSED? ########################################## # get current time nowdatetime = weibo_module.get_current_chinatime() timelapsed = -1 # when was the last time we checked most_recent_check = weibo_module.get_most_recent_checktime() # okay, so has it been long enough? timelapsed = nowdatetime - most_recent_check print "It's been " + weibo_module.minsec( weibo_module.total_seconds(timelapsed) ) + " min since our most recent check, which was on", most_recent_check if weibo_module.total_seconds(timelapsed) < weibo_settings.tracking_period_seconds: # not enough time has passed, too bad! print "... But we're checking posts every " + weibo_module.minsec( weibo_settings.tracking_period_seconds ) + " minutes!" print "We'll check next time." sys.exit(0) # never been tracked! so let's just go ahead print "Let's start tracking!" print "=====================" ##########################################