Updated for the csv conversion.

This commit is contained in:
Jeremy Fincher 2004-02-08 07:13:29 +00:00
parent 645d654ada
commit 578eb26470

View File

@ -56,16 +56,15 @@ if __name__ == '__main__':
cursor.execute("""SELECT actions, chars, frowns, joins, kicks, modes, cursor.execute("""SELECT actions, chars, frowns, joins, kicks, modes,
msgs, parts, quits, smileys, topics, words msgs, parts, quits, smileys, topics, words
FROM channel_stats""") FROM channel_stats""")
fd.write('%s:%s' % (channel, ','.join(map(str, cursor.fetchone())))) fd.write('%s,channelStats,%s' % \
(channel, ','join(map(str, cursor.fetchone()))))
fd.write(os.linesep) fd.write(os.linesep)
cursor.execute("""SELECT user_id, kicked, actions, chars, frowns, cursor.execute("""SELECT user_id, kicked, actions, chars, frowns,
joins, kicks, modes, msgs, parts, quits, joins, kicks, modes, msgs, parts, quits,
smileys, topics, words smileys, topics, words
FROM user_stats ORDER BY user_id""") FROM user_stats ORDER BY user_id""")
for t in cursor.fetchall(): for t in cursor.fetchall():
L = list(t) fd.write('%s,%s' % (channel, ','.join(map(str, L))))
id = L.pop(0)
fd.write('%s:%s:%s' % (id, channel, ','.join(map(str, L))))
fd.write(os.linesep) fd.write(os.linesep)
fd.close() fd.close()