|
import time |
|
from datetime import datetime |
|
|
|
|
|
def previouslyRepliedTo(submission, me): |
|
for comment in submission.comments: |
|
if comment.author == me: |
|
return True |
|
return False |
|
|
|
|
|
def waitWithComments(sleep_time, segment=60): |
|
"""Sleep for sleep_time seconds, printing to stdout every segment of time""" |
|
print("\t%s - %s seconds to go..." % (datetime.now(), sleep_time)) |
|
while sleep_time > segment: |
|
time.sleep(segment) |
|
sleep_time -= segment |
|
print("\t%s - %s seconds to go..." % (datetime.now(), sleep_time)) |
|
time.sleep(sleep_time) |
|
|
|
def logMessage(submission, status=""): |
|
print("{} | {} {}: {}".format(datetime.now(), submission.id, status, submission.title.encode('utf-8'))) |