Search Linux Wireless

[PATCH 05/11] rel-html: use system's date to determine current year

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is used for the software that does snapshot / next type of
releases based on dates.

Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx>
---
 rel-html.py | 10 +++++-----
 1 file 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@xxxxxxxxxxxxxxxx>
+# Copyright (C) 2012-2014 Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx>
 #
 # 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@xxxxxxxxxxxxxxxx>'
+    print 'Copyright (C) 2012-2014 Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx>'
     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:
-- 
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux