[los-cocos] r1219 committed - update license

4 views
Skip to first unread message

codesite...@google.com

unread,
Aug 12, 2012, 7:19:30 PM8/12/12
to cocos-...@googlegroups.com
Revision: 1219
Author: ccanepacc
Date: Sun Aug 12 16:18:19 2012
Log: update license
http://code.google.com/p/los-cocos/source/detail?r=1219

Deleted:
/trunk/tools/license.py
/trunk/tools/proper_license.py
Modified:
/trunk/cocos/__init__.py
/trunk/cocos/actions/__init__.py
/trunk/cocos/actions/base_actions.py
/trunk/cocos/actions/basegrid_actions.py
/trunk/cocos/actions/camera_actions.py
/trunk/cocos/actions/grid3d_actions.py
/trunk/cocos/actions/instant_actions.py
/trunk/cocos/actions/interval_actions.py
/trunk/cocos/actions/move_actions.py
/trunk/cocos/actions/quadmoveby_actions.py
/trunk/cocos/actions/tiledgrid_actions.py
/trunk/cocos/audio/__init__.py
/trunk/cocos/audio/actions.py
/trunk/cocos/audio/effect.py
/trunk/cocos/audio/exceptions.py
/trunk/cocos/audio/music.py
/trunk/cocos/batch.py
/trunk/cocos/camera.py
/trunk/cocos/cocosnode.py
/trunk/cocos/collision_model.py
/trunk/cocos/custom_clocks.py
/trunk/cocos/director.py
/trunk/cocos/draw.py
/trunk/cocos/framegrabber.py
/trunk/cocos/gl_framebuffer_object.py
/trunk/cocos/grid.py
/trunk/cocos/layer/__init__.py
/trunk/cocos/layer/base_layers.py
/trunk/cocos/layer/python_interpreter.py
/trunk/cocos/layer/scrolling.py
/trunk/cocos/layer/util_layers.py
/trunk/cocos/menu.py
/trunk/cocos/particle.py
/trunk/cocos/particle_systems.py
/trunk/cocos/path.py
/trunk/cocos/rect.py
/trunk/cocos/scene.py
/trunk/cocos/scenes/__init__.py
/trunk/cocos/scenes/pause.py
/trunk/cocos/scenes/transitions.py
/trunk/cocos/shader.py
/trunk/cocos/skeleton.py
/trunk/cocos/sprite.py
/trunk/cocos/text.py
/trunk/cocos/tiles.py
/trunk/cocos/utils.py
/trunk/cocos/wired.py
/trunk/tools/change_license.py
/trunk/tools/skeleton/anim_player.py
/trunk/tools/skeleton/animator.py
/trunk/tools/skeleton/skeleton_editor.py
/trunk/tools/skeleton/ui.py

=======================================
--- /trunk/tools/license.py Mon Jun 11 04:39:24 2012
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/python
-# $Id:$
-
-'''Rewrite the license header of source files.
-
-Usage:
- license.py file.py file.py dir/ dir/ ...
-'''
-
-import optparse
-import os
-import sys
-
-license = '''# cocos2d
-# Copyright (c) 2008 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
Lucio Torre
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of cocos2d nor the names of its
-# contributors may be used to endorse or promote products
-# derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.'''
-
-only_report_missing = True
-
-marker = '# ' + '-' * 76
-
-license_lines = [marker] + license.split('\n') + [marker]
-
-def update_license(filename):
- '''Open a Python source file and update the license header, writing
- it back in place.'''
- lines = [l.strip('\r\n') for l in open(filename).readlines()]
- if marker in lines and not only_report_missing:
- # Update existing license
- try:
- marker1 = lines.index(marker)
- marker2 = lines.index(marker, marker1 + 1)
- if marker in lines[marker2 + 1:]:
- raise ValueError() # too many markers
- lines = (lines[:marker1] +
- license_lines +
- lines[marker2 + 1:])
- except ValueError:
- print >> sys.stderr, "Can't update license in %s" % filename
- else:
- if only_report_missing:
- print filename
- else:
- # Add license to unmarked file
- # Skip over #! if present
- if not lines:
- pass # Skip empty files
- elif lines[0].startswith('#!'):
- lines = lines[:1] + license_lines + lines[1:]
- else:
- lines = license_lines + lines
- if not only_report_missing:
- open(filename, 'wb').write('\n'.join(lines) + '\n')
-
-if __name__ == '__main__':
- op = optparse.OptionParser()
- op.add_option('--exclude', action='append', default=[])
- options, args = op.parse_args()
-
- if len(args) < 1:
- print >> sys.stderr, __doc__
- sys.exit(0)
-
- for path in args:
- if os.path.isdir(path):
- for root, dirnames, filenames in os.walk(path):
- for dirname in dirnames:
- if dirname in options.exclude:
- dirnames.remove(dirname)
- for filename in filenames:
- if (filename.endswith('.py') and
- filename not in options.exclude):
- update_license(os.path.join(root, filename))
- else:
- update_license(path)
=======================================
--- /trunk/tools/proper_license.py Tue Jul 6 09:56:39 2010
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/python
-# $Id:$
-
-'''report files which not begin with the harcoded license
-
-Usage:
- proper_license.py file.py file.py dir/ dir/ ...
-'''
-
-import optparse
-import os
-import sys
-
-
-old_license = """#
----------------------------------------------------------------------------
-# cocos2d
-# Copyright (c) 2008 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
Lucio Torre
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of cocos2d nor the names of its
-# contributors may be used to endorse or promote products
-# derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
----------------------------------------------------------------------------"""
-
-new_license = """#
----------------------------------------------------------------------------
-# cocos2d
-# Copyright (c) 2008-2010 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
-# Lucio Torre
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of cocos2d nor the names of its
-# contributors may be used to endorse or promote products
-# derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
----------------------------------------------------------------------------"""
-
-def have_proper_license(filename):
- '''Open a Python source file and check if exactly begins with the
- text provided in the global license_
- Side effect: if the global report_no_proper is True will print the
filename
- '''
- global license_
- f = open(filename, 'rb')
- text = f.read()
- res = text.startswith(license_)
- f.close()
- if report_no_proper and not res:
- print filename
- return res
-
-if __name__ == '__main__':
- #license_ = old_license
- license_ = new_license
- report_no_proper = True
-
- op = optparse.OptionParser()
- op.add_option('--exclude', action='append', default=[])
- options, args = op.parse_args()
-
- if len(args) < 1:
- print >> sys.stderr, __doc__
- sys.exit(0)
-
- for path in args:
- if os.path.isdir(path):
- for root, dirnames, filenames in os.walk(path):
- for dirname in dirnames:
- if dirname in options.exclude:
- dirnames.remove(dirname)
- for filename in filenames:
- if (filename.endswith('.py') and
- filename not in options.exclude):
- have_proper_license(os.path.join(root, filename))
- else:
- have_proper_license(path)
=======================================
--- /trunk/cocos/__init__.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/__init__.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/__init__.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/actions/__init__.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/base_actions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/actions/base_actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/basegrid_actions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/actions/basegrid_actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/camera_actions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/actions/camera_actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/grid3d_actions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/actions/grid3d_actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/instant_actions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/actions/instant_actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/interval_actions.py Tue Jun 12 06:32:27 2012
+++ /trunk/cocos/actions/interval_actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/move_actions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/actions/move_actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/quadmoveby_actions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/actions/quadmoveby_actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/actions/tiledgrid_actions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/actions/tiledgrid_actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/audio/__init__.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/audio/__init__.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/audio/actions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/audio/actions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/audio/effect.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/audio/effect.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/audio/exceptions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/audio/exceptions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/audio/music.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/audio/music.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/batch.py Sat Aug 11 21:26:26 2012
+++ /trunk/cocos/batch.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/camera.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/camera.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/cocosnode.py Sat Aug 11 21:26:26 2012
+++ /trunk/cocos/cocosnode.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/collision_model.py Thu Oct 20 09:31:42 2011
+++ /trunk/cocos/collision_model.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2010 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/custom_clocks.py Sun Aug 12 11:24:34 2012
+++ /trunk/cocos/custom_clocks.py Sun Aug 12 16:18:19 2012
@@ -1,5 +1,6 @@
+#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/director.py Wed Jul 4 14:09:21 2012
+++ /trunk/cocos/director.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/draw.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/draw.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/framegrabber.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/framegrabber.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/gl_framebuffer_object.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/gl_framebuffer_object.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/grid.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/grid.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/layer/__init__.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/layer/__init__.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/layer/base_layers.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/layer/base_layers.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/layer/python_interpreter.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/layer/python_interpreter.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/layer/scrolling.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/layer/scrolling.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/layer/util_layers.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/layer/util_layers.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/menu.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/menu.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/particle.py Sat Jul 7 06:33:26 2012
+++ /trunk/cocos/particle.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/particle_systems.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/particle_systems.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/path.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/path.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/rect.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/rect.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/scene.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/scene.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/scenes/__init__.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/scenes/__init__.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/scenes/pause.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/scenes/pause.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/scenes/transitions.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/scenes/transitions.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,7 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
Lucio Torre
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Lucio Torre
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -8,7 +9,7 @@
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
+# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
=======================================
--- /trunk/cocos/shader.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/shader.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/skeleton.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/skeleton.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/sprite.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/sprite.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/text.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/text.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/tiles.py Tue Jun 12 22:28:05 2012
+++ /trunk/cocos/tiles.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/utils.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/utils.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/cocos/wired.py Mon Jun 11 04:39:24 2012
+++ /trunk/cocos/wired.py Sun Aug 12 16:18:19 2012
@@ -1,6 +1,6 @@
#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
=======================================
--- /trunk/tools/change_license.py Sun Aug 14 10:08:35 2011
+++ /trunk/tools/change_license.py Sun Aug 12 16:18:19 2012
@@ -1,16 +1,13 @@
#!/usr/bin/python
# $Id:$

-''' changes licence header
+"""script to work licence header - see usage or use --help

-Usage:
- dir_license.py file.py file.py dir/ dir/ ...
-
-For cocos 0.4RC0 we need to run over cocos and tools\skeleton
+For the last cocos releases we need to run over ..\cocos and skeleton
Be sure to check the hardcoded old_license, new_license, exclude are
the one intended.
use svn status to confirm what changed.
-'''
+"""

import optparse
import os
@@ -19,7 +16,7 @@

old_license = """#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2010 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
@@ -53,7 +50,7 @@

new_license = """#
----------------------------------------------------------------------------
# cocos2d
-# Copyright (c) 2008-2011 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
+# Copyright (c) 2008-2012 Daniel Moisset, Ricardo Quesada, Rayentray Tappa,
# Lucio Torre
# All rights reserved.
#
@@ -85,46 +82,86 @@
# POSSIBILITY OF SUCH DAMAGE.
#
----------------------------------------------------------------------------"""

+change_files = False
+report_match = False
+reported = []
+target_license = None
+
+headers = {
+ 'list-matching-new': 'Files with the new license:',
+ 'list-non-matching-new': 'Files without the new license:',
+ 'list-matching-old': 'Files with the old license:',
+ 'list-non-matching-old': 'Files not matching the old license',
+ 'change': 'Files changed:'}
+
+exclude = set([
+ 'pygame',
+ 'SDL',
+ 'euclid'
+ ])
+
# no proper error handling. If in trouble, svn revert , solve the problem,
# try again.
-def update_license(filename):
+def process_file(filename):
'''Open a Python source file and check if exactly begins with the
text provided in the global old_license; if yes, replace that text with
the one in the global new_license.
Side effect: if the global report_not_changed is True will print the
filename
if the file dont begins with the old_license text
'''
- global old_license, new_license, report_not_changed
- f = open(filename, 'rb')
+ global target_license, new_license, change_files, report_match,
reported
+ f = open(filename, 'rU')
text = f.read()
- res = text.startswith(old_license)
f.close()
- if report_not_changed and not res:
- print filename
- else:
- text = new_license + text[len(old_license):]
- f = open(filename, 'wb')
+ match = text.startswith(target_license)
+ if change_files and match:
+ text = new_license + text[len(target_license):]
+ f = open(filename, 'w')
f.write(text)
f.close()
- return res
+ if report_match == match:
+ reported.append(filename)

if __name__ == '__main__':
- report_not_changed = True
- op = optparse.OptionParser()
- #ignored, edit the hardcoded exclude
- op.add_option('--exclude', action='append', default=[])
+ usage = """
+ %prog [options] path1 path2 ...
+
+ With MODE one of 'list-matching-new', 'list-non-matching-new',
+ 'list-matching-old', 'list-non-matching-old' reports the files matching
+ (or not matching) the new or old license.
+
+ With MODE=change files matching the old license are changed to the new
one.
+
+ Default MODE is 'list-non-matching-old', meaning the files that don't
match
+ the old license.
+ """
+ op = optparse.OptionParser(usage = usage)
+ op.add_option('--mode', dest='mode', default='list-non-matching-old',
+ choices=['list-matching-new', 'list-non-matching-new',
+ 'list-matching-old', 'list-non-matching-old',
+ 'change'],
+ )
options, args = op.parse_args()

- exclude = set([
- 'pygame',
- 'SDL',
- 'euclid'
- ])
-
if len(args) < 1:
- print >> sys.stderr, __doc__
+ op.print_usage()
sys.exit(0)

+ mode = options.mode
+ print 'mode:', mode
+
+ assert mode in headers
+
+ print headers[mode]
+ change_files = (mode == 'change')
+ if change_files:
+ mode = 'list-matching-old'
+ if mode.endswith('old'):
+ target_license = old_license
+ else:
+ target_license = new_license
+ report_match = not ('non' in mode)
+
for path in args:
if os.path.isdir(path):
for root, dirnames, filenames in os.walk(path):
@@ -134,6 +171,11 @@
for filename in filenames:
if (filename.endswith('.py') and
filename not in exclude):
- update_license(os.path.join(root, filename))
+ process_file(os.path.join(root, filename))
else:
- update_license(path)
+ if (filename.endswith('.py') and
+ filename not in exclude):
+ process_file(path)
+
+ for name in reported:
+ print name
=======================================
***Additional files exist in this changeset.***
Reply all
Reply to author
Forward
0 new messages