def test_xpost(post, credentials, praw, sub): mysub = u.get_subreddit(credentials, praw, sub) val = a.xpost(post, mysub, "test") print "Xpost:" if val: print "Passed" return True else: print "Failed" return False
def __init__(self, homesub, altsub): super(DebugPolicy, self).__init__(homesub) self.on_blacklist = lambda post: Actions.xpost(post, altsub, "blacklist") self.on_whitelist = lambda post: Actions.xpost(post, altsub, "whitelist") self.altsub = altsub