IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Air Shower Physics
corsika
Commits
ebe51245
Commit
ebe51245
authored
5 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
python3
parent
3bedd301
No related branches found
No related tags found
1 merge request
!123
Copyright
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
do-copyright.py
+10
-10
10 additions, 10 deletions
do-copyright.py
with
10 additions
and
10 deletions
do-copyright.py
+
10
−
10
View file @
ebe51245
#!/usr/bin/python
#!/usr/bin/
env
python
3
import
os
import
sys
,
getopt
...
...
@@ -69,9 +69,9 @@ def checkNote(filename):
if
Debug
>
0
:
txt
=
"
states: n=
"
+
str
(
len
(
startNote
))
for
i
in
x
range
(
len
(
startNote
)):
for
i
in
range
(
len
(
startNote
)):
txt
+=
"
, [
"
+
str
(
startNote
[
i
])
+
"
-
"
+
str
(
endNote
[
i
])
+
"
]
"
print
(
"
stats:
"
)
+
txt
print
(
"
stats:
"
+
txt
)
# now check if first copyright notices is already identical...
isSame
=
False
...
...
@@ -86,7 +86,7 @@ def checkNote(filename):
if
not
re
.
match
(
regex
,
lines
[
startNote
[
0
]
+
iLine
].
strip
(
"
\n
"
)):
isSame
=
False
foundMissing
=
True
print
"
needs update:
"
+
filename
+
"
new=
\'
"
+
noteLines
[
iLine
+
1
]
+
"
\'
vs old=
\'
"
+
lines
[
startNote
[
0
]
+
iLine
].
rstrip
(
'
\n
'
)
+
"
\'
"
print
(
"
needs update:
"
+
filename
+
"
new=
\'
"
+
noteLines
[
iLine
+
1
]
+
"
\'
vs old=
\'
"
+
lines
[
startNote
[
0
]
+
iLine
].
rstrip
(
'
\n
'
)
+
"
\'
"
)
break
if
Debug
>
0
:
print
(
"
isSame=
"
+
str
(
isSame
)
+
"
"
+
str
(
len
(
startNote
)))
...
...
@@ -118,7 +118,7 @@ def checkNote(filename):
inBlock
=
False
for
iBlock
in
range
(
len
(
startNote
)):
if
iLine
>=
startNote
[
iBlock
]
and
iLine
<=
endNote
[
iBlock
]:
print
"
[remove
"
+
str
(
iBlock
)
+
"
]
"
+
(
lines
[
iLine
]).
strip
()
print
(
"
[remove
"
+
str
(
iBlock
)
+
"
]
"
+
(
lines
[
iLine
]).
strip
()
)
inBlock
=
True
skip
=
True
...
...
@@ -175,23 +175,23 @@ def main(argv):
try
:
opts
,
args
=
getopt
.
getopt
(
argv
,
"
cAhd:
"
,
[
"
check
"
,
"
add=
"
,
"
debug=
"
])
except
getopt
.
GetoptError
:
print
'
do-copyright.py [--check] [--add=YEAR] [--debug=0]
'
print
(
'
do-copyright.py [--check] [--add=YEAR] [--debug=0]
'
)
sys
.
exit
(
2
)
for
opt
,
arg
in
opts
:
if
opt
==
'
-h
'
:
print
'
do-copyright.py [--check] [--add=YEAR] [--debug=0]
'
print
(
'
do-copyright.py [--check] [--add=YEAR] [--debug=0]
'
)
sys
.
exit
()
elif
opt
in
(
"
-c
"
,
"
--check
"
):
justCheck
=
True
elif
opt
in
(
"
-A
"
,
"
--add
"
):
justCheck
=
False
forYear
=
str
(
arg
)
print
'
Adding
\'
Copyright
'
+
forYear
+
'
\'
notice, where needed.
'
print
(
'
Adding
\'
Copyright
'
+
forYear
+
'
\'
notice, where needed.
'
)
elif
opt
in
(
"
-d
"
,
"
--debug
"
):
Debug
=
int
(
arg
)
if
justCheck
:
print
'
Only checking. No changes. See
\'
do-copyright.py -h
\'
for options.
'
print
(
'
Only checking. No changes. See
\'
do-copyright.py -h
\'
for options.
'
)
for
root
,
dirs
,
files
in
os
.
walk
(
'
./
'
):
next_file
(
root
,
files
)
...
...
@@ -204,5 +204,5 @@ if __name__ == "__main__":
if
justCheck
and
foundMissing
:
sys
.
exit
(
-
1
)
# found error
print
"
Finished
"
print
(
"
Finished
"
)
sys
.
exit
(
0
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment