diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-01-24 11:13:51 -0800 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-01-24 11:13:51 -0800 |
commit | 28a78cf3b1a3687bbff066e52a794dc86c1cedd5 (patch) | |
tree | a7dd76674791ba2d5a2466bdf49df60ac6a51452 | |
parent | 22ee2dfdfe3ba7d8629be6a308a695a0ddd0b1f8 (diff) | |
download | rel-html-28a78cf3b1a3687bbff066e52a794dc86c1cedd5.tar.gz |
rel-html: use system's date to determine current year
This is used for the software that does snapshot / next type of
releases based on dates.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rwxr-xr-x | rel-html.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/rel-html.py b/rel-html.py index d787b92..ae61187 100755 --- a/rel-html.py +++ b/rel-html.py @@ -3,7 +3,7 @@ # Provided an index URL and a few project hints page this # will spit out a shiny HTML 5 W3C compliant releases page. -# Copyright (C) 2012-2013 Luis R. Rodriguez <mcgrof@do-not-panic.com> +# Copyright (C) 2012-2014 Luis R. Rodriguez <mcgrof@do-not-panic.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -27,13 +27,14 @@ import sys import os import getopt from operator import itemgetter +from datetime import date debug = 0 def rel_html_license_verbose(): print '-----------------------------------------------------------------------' - print 'Copyright (C) 2012-2013 Luis R. Rodriguez <mcgrof@do-not-panic.com>' + print 'Copyright (C) 2012-2014 Luis R. Rodriguez <mcgrof@do-not-panic.com>' print '' print 'This program is free software: you can redistribute it and/or modify' print 'it under the terms of the GNU Affero General Public License as' @@ -859,8 +860,7 @@ class index_parser(HTMLParser): url + self.next_rel_month) self.next_rel_url = url + \ self.next_rel_month + '/' + self.next_rel_day - # XXX: automatically look for the largest year - self.next_rel_date_rfc3339 = '2013' + '-' + \ + self.next_rel_date_rfc3339 = str(date.today().year) + '-' + \ self.next_rel_month + '-' + self.next_rel_day self.next_rel_date = self.next_rel_date_rfc3339.replace("-", "") self.next_rel_dates.append(self.next_rel_date_rfc3339) @@ -884,7 +884,7 @@ class index_parser(HTMLParser): if url.endswith('stable/'): self.get_stable_ext_urls(url) self.evaluate_stable_ext_urls() - elif url.endswith('2013/'): + elif url.endswith(str(date.today().year) + '/'): self.get_next_url(url) self.evaluate_next_url() else: |