diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-02-09 22:10:30 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-02-09 22:10:30 -0300 |
commit | 0b806ee0fc9097fa7bda7ac0109191c9c5e0a1ac (patch) | |
tree | 276c4d099e178eb67fbd14f61d77b05e3808e9e3 /tools/addheader | |
parent | 0e49da1687bc8192ed210947da52c9e5c5f301bb (diff) |
GODOT IS OPEN SOURCE
Diffstat (limited to 'tools/addheader')
-rw-r--r-- | tools/addheader/addheader.py | 72 | ||||
-rw-r--r-- | tools/addheader/files | 160 | ||||
-rw-r--r-- | tools/addheader/header.txt | 12 |
3 files changed, 244 insertions, 0 deletions
diff --git a/tools/addheader/addheader.py b/tools/addheader/addheader.py new file mode 100644 index 0000000000..6870a1e926 --- /dev/null +++ b/tools/addheader/addheader.py @@ -0,0 +1,72 @@ +header="""\ +/*************************************************************************/ +/* $filename */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +""" + +f = open("files","rb") + +fname = f.readline() +while (fname!=""): + + fr = open(fname.strip(),"rb") + l = fr.readline() + bc=False + fsingle = fname.strip() + + if (fsingle.find("/")!=-1): + fsingle=fsingle[fsingle.rfind("/")+1:] + rep_fl="$filename" + rep_fi=fsingle + len_fl=len(rep_fl) + len_fi=len(rep_fi) + if (len_fi<len_fl): + for x in range(len_fl-len_fi): + rep_fi+=" " + elif (len_fl<len_fi): + for x in range(len_fi-len_fl): + rep_fl+=" " + if (header.find(rep_fl)!=-1): + text=header.replace(rep_fl,rep_fi) + else: + text=header.replace("$filename",fsingle) + + + while (l!=""): + if ((l.find("//")!=0 and l.find("/*")!=0 and l.strip()!="") or bc): + text+=l + bc=True + l=fr.readline() + + fr.close() + fr=open(fname.strip(),"wb") + fr.write(text) + fr.close() + #print(text) + fname=f.readline() + diff --git a/tools/addheader/files b/tools/addheader/files new file mode 100644 index 0000000000..73bbc7de8c --- /dev/null +++ b/tools/addheader/files @@ -0,0 +1,160 @@ +./scene/*.h +./scene/*.cpp +./scene/io/*.h +./scene/io/*.cpp +./scene/main/*.h +./scene/main/*.cpp +./scene/resources/*.h +./scene/resources/*.cpp +./scene/gui/*.h +./scene/gui/*.cpp +./scene/audio/*.h +./scene/audio/*.cpp +./scene/3d/*.h +./scene/3d/*.cpp +./scene/2d/*.h +./scene/2d/*.cpp +./scene/animation/*.h +./scene/animation/*.cpp +./bin/tests/*.h +./bin/tests/*.cpp +./main/*.h +./main/*.cpp +./modules/gridmap/*.h +./modules/gridmap/*.cpp +./servers/*.h +./servers/*.cpp +./servers/physics_2d/*.h +./servers/physics_2d/*.cpp +./servers/physics/*.h +./servers/physics/*.cpp +./servers/visual/*.h +./servers/visual/*.cpp +./servers/spatial_sound_2d/*.h +./servers/spatial_sound_2d/*.cpp +./servers/audio/*.h +./servers/audio/*.cpp +./tools/doc/doc_data.h +./tools/doc/doc_data.cpp +./tools/collada/collada.h +./tools/collada/collada.cpp +./tools/editor/*.h +./tools/editor/*.cpp +./tools/editor/plugins/*.h +./tools/editor/plugins/*.cpp +./tools/editor/io_plugins/*.h +./tools/editor/io_plugins/*.cpp +./tools/docdump/doc_dump.h +./tools/docdump/doc_dump.cpp +./core/*.h +./core/*.cpp +./core/io/object_format_binary.h +./core/io/file_access_buffered_fa.h +./core/io/file_access_buffered.h +./core/io/resource_saver.h +./core/io/file_access_compressed.cpp +./core/io/object_format_xml.cpp +./core/io/http_client.h +./core/io/object_format_xml.h +./core/io/compression.h +./core/io/ip_address.h +./core/io/file_access_pack.h +./core/io/ip.h +./core/io/tcp_server.h +./core/io/tcp_server.cpp +./core/io/packet_peer.cpp +./core/io/marshalls.h +./core/io/stream_peer.cpp +./core/io/resource_loader.cpp +./core/io/stream_peer_tcp.h +./core/io/stream_peer_tcp.cpp +./core/io/translation_loader_po.h +./core/io/zip_io.h +./core/io/ip_address.cpp +./core/io/object_saver_base.cpp +./core/io/object_loader.cpp +./core/io/xml_parser.h +./core/io/file_access_network.cpp +./core/io/resource_loader.h +./core/io/packet_peer.h +./core/io/stream_peer.h +./core/io/marshalls.cpp +./core/io/config_file.h +./core/io/ip.cpp +./core/io/file_access_zip.cpp +./core/io/resource_format_binary.h +./core/io/image_loader.h +./core/io/file_access_zip.h +./core/io/http_client.cpp +./core/io/file_access_memory.h +./core/io/xml_parser.cpp +./core/io/object_saver_base.h +./core/io/object_saver.cpp +./core/io/compression.cpp +./core/io/resource_format_xml.cpp +./core/io/object_format_binary.cpp +./core/io/file_access_compressed.h +./core/io/json.h +./core/io/file_access_pack.cpp +./core/io/resource_format_binary.cpp +./core/io/object_loader.h +./core/io/object_saver.h +./core/io/json.cpp +./core/io/file_access_network.h +./core/io/resource_saver.cpp +./core/io/file_access_memory.cpp +./core/io/image_loader.cpp +./core/io/resource_format_xml.h +./core/io/file_access_buffered.cpp +./core/io/config_file.cpp +./core/io/translation_loader_po.cpp +./core/os/*.h +./core/os/*.cpp +./core/math/*.h +./core/math/*.cpp +./script/gdscript/*.h +./script/gdscript/*.cpp +./script/multiscript/multi_script.cpp +./script/multiscript/multi_script.h +./script/register_script_types.h +./platform/nacl/*.h +./platform/nacl/*.cpp +./platform/android/*.h +./platform/android/*.cpp +./platform/android/java/src/com/android/godot/*.java +./platform/server/*.h +./platform/server/*.cpp +./platform/bb10/*.h +./platform/bb10/*.cpp +./platform/javascript/*.h +./platform/javascript/*.cpp +./platform/javascript/export/export.h +./platform/javascript/export/export.cpp +./platform/iphone/*.h +./platform/iphone/*.cpp +./platform/iphone/*.mm +./platform/windows/*.h +./platform/windows/*.cpp +./platform/osx/*.h +./platform/osx/*.cpp +./platform/osx/*.mm +./platform/x11/*.h +./platform/x11/*.cpp +./drivers/unix/*.h +./drivers/unix/*.cpp +./drivers/gles2/*.h +./drivers/gles2/*.cpp +./drivers/chibi/*.h +./drivers/chibi/*.cpp +./drivers/png/resource_saver_png.cpp +./drivers/png/image_loader_png.cpp +./drivers/png/image_loader_png.h +./drivers/vorbis/audio_stream_ogg_vorbis.h +./drivers/vorbis/audio_stream_ogg_vorbis.cpp +./drivers/gl_context/context_gl.h +./drivers/gles1/*.h +./drivers/gles1/*.cpp +./drivers/windows/*.h +./drivers/windows/*.cpp +./drivers/alsa/audio_driver_alsa.h +./drivers/alsa/audio_driver_alsa.cpp diff --git a/tools/addheader/header.txt b/tools/addheader/header.txt new file mode 100644 index 0000000000..359949cc3b --- /dev/null +++ b/tools/addheader/header.txt @@ -0,0 +1,12 @@ +/*************************************************/ +/* $filename */ +/*************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/*************************************************/ +/* Source code within this file is: */ +/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* All Rights Reserved. */ +/*************************************************/ + + |