-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangetext
executable file
·78 lines (66 loc) · 2.19 KB
/
changetext
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/python3
import re
import sys
# regex=re.compile("(\s\* Copyright (.|\n)* \*\/)")
# the old LGPL licensing
cp1=""" * Copyright 2017 Valkka Security Ltd. and Sampsa Riikonen.
*
* Authors: Sampsa Riikonen <[email protected]>
*
* This file is part of Valkka library.
*
* Valkka is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Valkka is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Valkka. If not, see <http://www.gnu.org/licenses/>.
*
"""
# AGPL licensing (since 2018) # removed the authors section from here ..
cp2=""" * Copyright 2017, 2018 Valkka Security Ltd. and Sampsa Riikonen.
*
* This file is part of the Valkka library.
*
* Valkka is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
"""
cpp=cp2
newlines=[]
fname=sys.argv[1]
f=open(fname,"r")
subs=False
for line in f:
if (line.find("* Copyright")>-1):
subs=True
if (subs and (line.find("*/")>-1)):
subs=False
# print(cpp[0:-1])
newlines.append(cpp)
if (not subs):
# print(line[0:-1])
newlines.append(line)
f.close()
# f=open("paska.txt","w")
f=open(fname,"w")
for line in newlines:
# print(line)
f.write(line)
f.close()