Browse Source

Automatically update copyright (Closes #549)

download-server-ytdl-org
Philipp Hagemeister 12 years ago
parent
commit
23cf656bd1
8 changed files with 28 additions and 6 deletions
  1. +1
    -0
      Makefile
  2. +1
    -1
      about.html
  3. +1
    -1
      documentation.html
  4. +1
    -1
      download.html
  5. +1
    -1
      faq.html
  6. +1
    -1
      index.html
  7. +21
    -0
      update-copyright
  8. +1
    -1
      windows.html

+ 1
- 0
Makefile View File

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

+ 1
- 1
about.html View File

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

+ 1
- 1
documentation.html View File

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

+ 1
- 1
download.html View File

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

+ 1
- 1
faq.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/">
<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>

+ 1
- 1
index.html View File

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

+ 21
- 0
update-copyright 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)

+ 1
- 1
windows.html View File

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

Loading…
Cancel
Save