summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-11-26 11:19:40 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-11-26 11:19:40 +0100
commit23cf656bd1bf8fce19e73ba379abb83febed4c79 (patch)
tree61df69e7d36e990472fa59d4dce6d7826d71ca71
parent41ff5333f7d6b81d5f558de658c9d2840d376ff0 (diff)
downloadyoutube-dl-23cf656bd1bf8fce19e73ba379abb83febed4c79.tar.gz
youtube-dl-23cf656bd1bf8fce19e73ba379abb83febed4c79.tar.xz
youtube-dl-23cf656bd1bf8fce19e73ba379abb83febed4c79.zip
Automatically update copyright (Closes #549)
-rw-r--r--Makefile1
-rw-r--r--about.html2
-rw-r--r--documentation.html2
-rw-r--r--download.html2
-rw-r--r--faq.html2
-rw-r--r--index.html2
-rw-r--r--update-copyright21
-rw-r--r--windows.html2
8 files changed, 28 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index dc381dc02..71d211290 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
 update:
 	python ./generate-download
+	python ./update-copyright
 
 .PHONY: update
 
diff --git a/about.html b/about.html
index 26f1c3b9c..a6f87f365 100644
--- a/about.html
+++ b/about.html
@@ -35,6 +35,6 @@
 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
 <img alt="Creative Commons License" style="border-width:0"
 src="http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png" /></a><br />
-Copyright © 2006-2011 Ricardo Garcia Gonzalez</div>
+Copyright © 2006-2012 Ricardo Garcia Gonzalez</div>
 </body>
 </html>
diff --git a/documentation.html b/documentation.html
index b43444437..4b7b8edc2 100644
--- a/documentation.html
+++ b/documentation.html
@@ -99,6 +99,6 @@
 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
 <img alt="Creative Commons License" style="border-width:0"
 src="http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png" /></a><br />
-Copyright © 2006-2011 Ricardo Garcia Gonzalez</div>
+Copyright © 2006-2012 Ricardo Garcia Gonzalez</div>
 </body>
 </html>
diff --git a/download.html b/download.html
index 55014697c..9754f7ac3 100644
--- a/download.html
+++ b/download.html
@@ -28,6 +28,6 @@
 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
 <img alt="Creative Commons License" style="border-width:0"
 src="http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png" /></a><br />
-Copyright © 2006-2011 Ricardo Garcia Gonzalez</div>
+Copyright © 2006-2012 Ricardo Garcia Gonzalez</div>
 </body>
 </html>
diff --git a/faq.html b/faq.html
index 418d0f324..ca7afe036 100644
--- a/faq.html
+++ b/faq.html
@@ -94,6 +94,6 @@ Please note that Python 2.5 is not supported anymore.</p>
 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
 <img alt="Creative Commons License" style="border-width:0"
 src="http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png" /></a><br />
-Copyright © 2006-2011 Ricardo Garcia Gonzalez</div>
+Copyright © 2006-2012 Ricardo Garcia Gonzalez</div>
 </body>
 </html>
diff --git a/index.html b/index.html
index 885d369bd..208aef366 100644
--- a/index.html
+++ b/index.html
@@ -26,6 +26,6 @@
 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
 <img alt="Creative Commons License" style="border-width:0"
 src="http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png" /></a><br />
-Copyright © 2006-2011 Ricardo Garcia Gonzalez</div>
+Copyright © 2006-2012 Ricardo Garcia Gonzalez</div>
 </body>
 </html>
diff --git a/update-copyright b/update-copyright
new file mode 100644
index 000000000..a37c4cada
--- /dev/null
+++ b/update-copyright
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+# coding: utf-8
+
+from __future__ import with_statement
+
+import datetime
+import glob
+import io # For Python 2 compatibilty
+import os
+import re
+
+year = str(datetime.datetime.now().year)
+for fn in glob.glob('*.html'):
+    with io.open(fn, encoding='utf-8') as f:
+        content = f.read()
+    newc = re.sub(ur'(?P<copyright>Copyright © 2006-)(?P<year>[0-9]{4})', u'Copyright © 2006-' + year, content)
+    if content != newc:
+        tmpFn = fn + '.part'
+        with io.open(tmpFn, 'wt', encoding='utf-8') as outf:
+            outf.write(newc)
+        os.rename(tmpFn, fn)
diff --git a/windows.html b/windows.html
index d9b04c749..49da3aa3a 100644
--- a/windows.html
+++ b/windows.html
@@ -18,6 +18,6 @@
 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
 <img alt="Creative Commons License" style="border-width:0"
 src="http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png" /></a><br />
-Copyright © 2006-2011 Ricardo Garcia Gonzalez</div>
+Copyright © 2006-2012 Ricardo Garcia Gonzalez</div>
 </body>
 </html>