-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into features/python3
- Loading branch information
Showing
766 changed files
with
3,667 additions
and
2,676 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,67 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
# libavg - Media Playback Engine. | ||
# Copyright (C) 2011-2020 Ulrich von Zadow | ||
# | ||
# This library 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 2 of the License, or (at your option) any later version. | ||
# | ||
# This library 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 | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
# | ||
# Current versions can be found at www.libavg.de | ||
|
||
import os | ||
import re | ||
import time | ||
|
||
TEMPLATE = 'Copyright (C) %s-%s Ulrich von Zadow\n' | ||
|
||
num_changed = 0 | ||
num_skipped = 0 | ||
|
||
|
||
def handleFile(path): | ||
global num_changed, num_skipped | ||
|
||
lines = file(path).readlines() | ||
lineNumber = 0 | ||
found = False | ||
for i, line in enumerate(lines): | ||
match = re.match(r'((//)|(#))\s*Copyright \(C\) 2003-(.*) Ulrich von Zadow\s*', line) | ||
# m = re.match(r'#include\s*["<]([\-_a-zA-Z0-9\.\\/]+)[">]\s*', l) | ||
match = re.match(r'((//)|(#))\s*Copyright \(C\) (?P<from>\d{4})(.*) Ulrich von Zadow\s*', line) | ||
if match: | ||
year_from = match.group('from') | ||
year_to = str(time.localtime().tm_year) | ||
if path[-2:] == 'py': | ||
lines[i] = "# Copyright (C) 2003-2014 Ulrich von Zadow\n" | ||
lines[i] = '# ' + TEMPLATE % (year_from, year_to) | ||
else: | ||
lines[i] = "// Copyright (C) 2003-2014 Ulrich von Zadow\n" | ||
lines[i] = '// ' + TEMPLATE % (year_from, year_to) | ||
found = True | ||
break | ||
if found: | ||
num_changed +=1 | ||
outFile = open(path, "w") | ||
for line in lines: | ||
outFile.write(line) | ||
else: | ||
print path | ||
|
||
num_skipped +=1 | ||
print 'skipping', path | ||
|
||
|
||
# TODO: include src/graphics/shaders/*, python/scripts/* | ||
for ext in ("h", "c", "cpp", "py"): | ||
cmd = 'find . -name "*.'+ext+'"' | ||
cmd = 'find . -name "*.'+ext+'" -not -wholename "'+__file__+'"' | ||
files = os.popen(cmd).readlines() | ||
for f in files: | ||
handleFile(f.strip()) | ||
|
||
print 'changed:', num_changed | ||
print 'skipped:', num_skipped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.