Mercurial > hg > rlgallery-misc
comparison web/archive.cgi @ 5:a583700c0ca4
web/archive.cgi: fix backward comparisons.
Some form-printing code was using != instead of ==, which led to the
date defaulting to today whenever it was specified.
author | John "Elwin" Edwards <elwin@sdf.org> |
---|---|
date | Sun, 19 Aug 2012 15:26:18 -0700 |
parents | f5a37cc7f41f |
children | 4778ab7de7aa |
comparison
equal
deleted
inserted
replaced
4:f5a37cc7f41f | 5:a583700c0ca4 |
---|---|
54 tf = '<input type="text" size="2" maxlength="2" name="{0}" value="{1:02}">' | 54 tf = '<input type="text" size="2" maxlength="2" name="{0}" value="{1:02}">' |
55 emptf = '<input type="text" size="2" maxlength="2" name="{0}">' | 55 emptf = '<input type="text" size="2" maxlength="2" name="{0}">' |
56 sstr = '<div>Date: <select name="year">\n' | 56 sstr = '<div>Date: <select name="year">\n' |
57 # Default to today | 57 # Default to today |
58 now = datetime.now(rlgall.utc) | 58 now = datetime.now(rlgall.utc) |
59 if dvals[0] != None: | 59 if dvals[0] == None: |
60 dvals[0] = now.year | 60 dvals[0] = now.year |
61 if dvals[1] != None: | 61 if dvals[1] == None: |
62 dvals[1] = now.month | 62 dvals[1] = now.month |
63 if dvals[2] != None: | 63 if dvals[2] == None: |
64 dvals[2] = now.day | 64 dvals[2] = now.day |
65 for year in range(2010, now.year + 1): | 65 for year in range(2010, now.year + 1): |
66 if year == dvals[0]: | 66 if year == dvals[0]: |
67 sstr += soptstr.format(year, year) | 67 sstr += soptstr.format(year, year) |
68 else: | 68 else: |