]>
Raphaël G. Git Repositories - youtubedl/blob - devscripts/gh-pages/update-copyright.py
12c2a91949135d72edf53e41d15ae532690bc6bf
4 from __future__
import with_statement
8 import io
# For Python 2 compatibilty
12 year
= str(datetime
.datetime
.now().year
)
13 for fn
in glob
.glob('*.html*'):
14 with io
.open(fn
, encoding
='utf-8') as f
:
16 newc
= re
.sub(u
'(?P<copyright>Copyright © 2006-)(?P<year>[0-9]{4})', u
'Copyright © 2006-' + year
, content
)
19 with io
.open(tmpFn
, 'wt', encoding
='utf-8') as outf
: