| 1234567891011121314151617181920212223242526 | #!/usr/bin/env python# coding: utf-8from __future__ import with_statement, unicode_literalsimport datetimeimport globimport osimport reimport sysdirn = os.path.dirnamesys.path.insert(0, dirn(dirn(dirn(os.path.abspath(__file__)))))from devscripts.utils import read_file, write_filefrom youtube_dl import compat_stryear = compat_str(datetime.datetime.now().year)for fn in glob.glob('*.html*'):    content = read_file(fn)    newc = re.sub(r'(?P<copyright>Copyright © 2011-)(?P<year>[0-9]{4})', 'Copyright © 2011-' + year, content)    if content != newc:        tmpFn = fn + '.part'        write_file(tmpFn, newc)        os.rename(tmpFn, fn)
 |