twisterp2pblockchainnetworkbittorrentipv6microbloggingsocial-networkdhtdecentralizedtwister-coretwisterarmyp2p-networktwister-servertwister-ipv6
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
667 B
31 lines
667 B
11 years ago
|
#! /usr/bin/env python
|
||
|
import os
|
||
|
import sys
|
||
|
import glob
|
||
|
import datetime
|
||
|
|
||
|
this_year = datetime.date.today().year
|
||
|
print 'current year: %d' % this_year
|
||
|
|
||
|
def update_file(name):
|
||
|
subst = ''
|
||
|
f = open(name)
|
||
|
for l in f:
|
||
|
if l.startswith('Copyright (c) '):
|
||
|
first_year = int(l[14:18])
|
||
|
if first_year != this_year:
|
||
|
if l[18] == '-':
|
||
|
l = l[:19] + str(this_year) + l[23:]
|
||
|
else:
|
||
|
l = l[:18] + '-' + str(this_year) + l[18:]
|
||
|
|
||
|
subst += l
|
||
|
|
||
|
f.close()
|
||
|
open(name, 'w+').write(subst)
|
||
|
|
||
|
for i in glob.glob('src/*.cpp') + glob.glob('include/libtorrent/*.hpp') + \
|
||
|
glob.glob('include/libtorrent/kademlia/*.hpp') + glob.glob('src/kademlia/*.cpp'):
|
||
|
update_file(i)
|
||
|
|