Mercurial > hg > rlgallery-misc
diff web/archive.cgi @ 4:f5a37cc7f41f
Continue removing the time module.
Convert some more struct_time instances to datetime objects.
author | John "Elwin" Edwards <elwin@sdf.org> |
---|---|
date | Thu, 26 Jul 2012 10:14:56 -0700 |
parents | a943cfdfbad9 |
children | a583700c0ca4 |
line wrap: on
line diff
--- a/web/archive.cgi Thu Jul 26 09:35:07 2012 -0700 +++ b/web/archive.cgi Thu Jul 26 10:14:56 2012 -0700 @@ -55,11 +55,14 @@ emptf = '<input type="text" size="2" maxlength="2" name="{0}">' sstr = '<div>Date: <select name="year">\n' # Default to today - now = time.gmtime() - for dindex in range(3): - if not dvals[dindex]: - dvals[dindex] = now[dindex] - for year in range(2010, now[0] + 1): + now = datetime.now(rlgall.utc) + if dvals[0] != None: + dvals[0] = now.year + if dvals[1] != None: + dvals[1] = now.month + if dvals[2] != None: + dvals[2] = now.day + for year in range(2010, now.year + 1): if year == dvals[0]: sstr += soptstr.format(year, year) else: @@ -279,8 +282,6 @@ dosearch = formname != None and dungeon != None and searchtime != None # Find the actual files, and put them in a list called gamefiles. -gtimes = [0, int(time.time())] -relgame = None gamefiles = [] if dosearch: query1 = "SELECT ttyrecs FROM {0} WHERE name = %s AND startt <= %s AND endt >= %s;".format(dungeon.uname)