Started working on formatting the post timestamps

This commit is contained in:
Anna 2010-04-08 01:17:21 -04:00
parent 928b75ab95
commit 06f571767e

View File

@ -2,7 +2,7 @@
# #
# Custom twitter client... mostly for learning Python # Custom twitter client... mostly for learning Python
import sys, twitter, Tkinter, Pmw, ConfigParser, os, tkMessageBox import sys, twitter, Tkinter, Pmw, ConfigParser, os, tkMessageBox, datetime
class TwitWindow: class TwitWindow:
@ -84,6 +84,12 @@ class TwitWindow:
if i < len(statuses): if i < len(statuses):
# Update the label with the user's name and screen name # Update the label with the user's name and screen name
user = statuses[i].user user = statuses[i].user
# fixme: need to find a way to detect local timezone and print in that
# Also need to decide how to format the output... maybe use a config var?
# timestamp = datetime.datetime.strptime(statuses[i].created_at, "%a %b %d %H:%M:%S %z %Y")
# timestring = timestamp.strftime()
labeltext = user.name + " (" + user.screen_name + ") " + statuses[i].created_at labeltext = user.name + " (" + user.screen_name + ") " + statuses[i].created_at
self.labels[i].config(text=labeltext) self.labels[i].config(text=labeltext)