1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-12-25 07:47:55 +01:00

Automatically update copyright (Closes #549)

This commit is contained in:
Philipp Hagemeister 2012-11-26 11:19:40 +01:00
parent 41ff5333f7
commit 23cf656bd1
8 changed files with 28 additions and 6 deletions

View File

@ -1,5 +1,6 @@
update: update:
python ./generate-download python ./generate-download
python ./update-copyright
.PHONY: update .PHONY: update

View File

@ -35,6 +35,6 @@
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
<img alt="Creative Commons License" style="border-width: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 /> 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> </body>
</html> </html>

View File

@ -99,6 +99,6 @@
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
<img alt="Creative Commons License" style="border-width: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 /> 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> </body>
</html> </html>

View File

@ -28,6 +28,6 @@
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
<img alt="Creative Commons License" style="border-width: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 /> 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> </body>
</html> </html>

View File

@ -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/"> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
<img alt="Creative Commons License" style="border-width: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 /> 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> </body>
</html> </html>

View File

@ -26,6 +26,6 @@
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
<img alt="Creative Commons License" style="border-width: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 /> 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> </body>
</html> </html>

21
update-copyright Normal file
View File

@ -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)

View File

@ -18,6 +18,6 @@
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">
<img alt="Creative Commons License" style="border-width: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 /> 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> </body>
</html> </html>