Skip to content

Instantly share code, notes, and snippets.

@chromakode
Created March 10, 2010 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chromakode/327671 to your computer and use it in GitHub Desktop.
Save chromakode/327671 to your computer and use it in GitHub Desktop.
# <snip>
for line in f:
m = LOG_RE.match(line)
if m:
when = time.mktime(time.strptime(m.group("when"), "%d-%m-%Y %H:%M:%S"))
# Bwahahahaha.
_time = time.time
time.time = lambda: when
try:
bot.privmsg(m.group("user"), channel, m.group("msg"))
except Exception as e:
log.err()
finally:
time.time = _time
# </snip>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment