#!/usr/bin/python
verbosity = 0
if __name__ == '__main__':
	verbosity = 1
import sys, agora, dbfunc, time, person, traceback, agora_sys
for i in dbfunc.exeq('SELECT action, UNIX_TIMESTAMP(action_time) AS action_time FROM actions WHERE is_valid = 1 ORDER BY action_time').fetchall():
	command = i.action
	if verbosity >= 2: print '* %s' % command
	agora.action_time = i.action_time
	try:
		exec command
	except:
		if verbosity >= 2:
			traceback.print_exc()
		elif verbosity == 1:
			print '! %s' % command
	else:
		if verbosity == 1:
			print '* %s' % command
		