Skip to content

Commit

Permalink
Merge branch 'master' into features/python3
Browse files Browse the repository at this point in the history
  • Loading branch information
scotty007 committed Sep 8, 2020
2 parents 8cc3f90 + d29f378 commit 293211c
Show file tree
Hide file tree
Showing 766 changed files with 3,667 additions and 2,676 deletions.
4 changes: 2 additions & 2 deletions CreateVersionFile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand All @@ -18,7 +19,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Current versions can be found at www.libavg.de
#

# The script generates a header file that contains versioning data for
# the current build.
Expand Down
51 changes: 43 additions & 8 deletions fixcopyright.py
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
25 changes: 21 additions & 4 deletions python/libavg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# libavg is a high-level development platform for media-centric applications.
# https://www.libavg.de
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-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

# Work around libstdc++ Mesa bug
# (https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/259219)
Expand All @@ -13,8 +32,6 @@
from .avg import *
player = avg.Player.get()

from .enumcompat import *

from . import textarea
from . import statemachine
from . import utils, methodref
Expand Down
2 changes: 1 addition & 1 deletion python/libavg/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand Down
2 changes: 1 addition & 1 deletion python/libavg/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand Down
4 changes: 2 additions & 2 deletions python/libavg/app/debugpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand Down Expand Up @@ -374,7 +374,7 @@ def update(self):
else:
key = keystring

if binding.type == libavg.avg.KEYDOWN:
if binding.type == libavg.avg.Event.KEY_DOWN:
key = '%s %s' % (chr(8595), key)
else:
key = '%s %s' % (chr(8593), key)
Expand Down
2 changes: 1 addition & 1 deletion python/libavg/app/flashmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand Down
10 changes: 5 additions & 5 deletions python/libavg/app/keyboardmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand Down Expand Up @@ -60,17 +60,17 @@ def init():

def bindKeyDown(scancode=None, keyname=None, text=None, handler=None, help=None,
modifiers=avg.KEYMOD_NONE):
_bindKey(scancode, keyname, text, handler, help, modifiers, avg.KEYDOWN)
_bindKey(scancode, keyname, text, handler, help, modifiers, avg.Event.KEY_DOWN)

def bindKeyUp(scancode=None, keyname=None, handler=None, help=None,
modifiers=avg.KEYMOD_NONE):
_bindKey(scancode, keyname, None, handler, help, modifiers, avg.KEYUP)
_bindKey(scancode, keyname, None, handler, help, modifiers, avg.Event.KEY_UP)

def unbindKeyDown(scancode=None, keyname=None, text=None, modifiers=avg.KEYMOD_NONE):
_unbindKey(scancode, keyname, text, modifiers, avg.KEYDOWN)
_unbindKey(scancode, keyname, text, modifiers, avg.Event.KEY_DOWN)

def unbindKeyUp(scancode=None, keyname=None, modifiers=avg.KEYMOD_NONE):
_unbindKey(scancode, keyname, None, modifiers, avg.KEYUP)
_unbindKey(scancode, keyname, None, modifiers, avg.Event.KEY_UP)

def unbindAll():
global _keyBindings, _keyBindingsStack
Expand Down
2 changes: 1 addition & 1 deletion python/libavg/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand Down
6 changes: 4 additions & 2 deletions python/libavg/app/touchvisualization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand All @@ -16,7 +19,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Current versions can be found at www.libavg.de
#

import os

Expand Down
6 changes: 4 additions & 2 deletions python/libavg/apphelpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand All @@ -16,7 +19,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Current versions can be found at www.libavg.de
#

import os

Expand Down
37 changes: 0 additions & 37 deletions python/libavg/enumcompat.py

This file was deleted.

5 changes: 3 additions & 2 deletions python/libavg/filter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand All @@ -17,7 +19,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Current versions can be found at www.libavg.de
#

import math

Expand Down
6 changes: 4 additions & 2 deletions python/libavg/geom.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand All @@ -16,7 +19,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Current versions can be found at www.libavg.de
#

from libavg import avg

Expand Down
5 changes: 3 additions & 2 deletions python/libavg/gesture.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand All @@ -17,7 +19,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Current versions can be found at www.libavg.de
#

from libavg import avg, statemachine, player, filter

Expand Down
5 changes: 4 additions & 1 deletion python/libavg/graph.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand Down
5 changes: 4 additions & 1 deletion python/libavg/methodref.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand Down
3 changes: 2 additions & 1 deletion python/libavg/mtemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand All @@ -19,6 +19,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Current versions can be found at www.libavg.de
#
# Original author of this file is Sebastian Maulbeck
# <sm (at) archimedes-solutions (dot) de>

Expand Down
5 changes: 2 additions & 3 deletions python/libavg/parsecamargs.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#

# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
# Copyright (C) 2003-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
Expand All @@ -19,7 +19,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Current versions can be found at www.libavg.de
#

from libavg import avg

Expand Down

0 comments on commit 293211c

Please sign in to comment.