From 05111e25fd10aa140cd823d37ca884b73dad2725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Mon, 16 Nov 2009 19:20:33 +0100 Subject: Removing obsolete files. diff --git a/BuildTools/Copyrighter.py b/BuildTools/Copyrighter.py new file mode 100755 index 0000000..189dcf5 --- /dev/null +++ b/BuildTools/Copyrighter.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +#coding=utf-8 + +import os, re, datetime + +TEMPLATE = """/* + * Copyright (c) %(year)s %(author)s. + * See the included COPYING file for license details. + */ + +""" + +def updateCopyright(fileName) : + file = open(fileName) + fileData = "" + + author = "" + startYear = "" + endYear = "" + previousCopyright = "" + + # Retrieve previous copyright information + header = "" + inHeader = False + inSpaceBelowHeader = False + lines = file.readlines() + lines2 = lines + for line in lines2 : + lines.pop(0) + if inSpaceBelowHeader : + if line.strip() != "" : + break + elif inHeader : + if line.startswith(" */") : + inSpaceBelowHeader = True + else : + header += line + else : + if line.strip() == "" : + continue + elif line.startswith("/*") : + inHeader = True + header += line + else : + fileData += line + break + if "Copyright" in header : + previousCopyright = header + m = re.match("\* Copyright \(c\) (?P\d\d\d\d)(-(?P\d\d\d\d))? (?P.*)", header) + if m : + author = m.group("author") + startYear = m.group("startYear") + endYear = m.group("endYear") + elif header != "" : + fileData = header + file.close() + + # Read in the rest of the data + fileData += "".join(lines) + + # Guess empty values + if author == "" : + if "Swift/" in fileName : + author = "Kevin Smith" + else : + author = u"Remko Tronçon" + if startYear == "" : + startYear = datetime.date.today().strftime("%Y") + elif endYear == "" : + ## TODO: Guess end year by looking at git log --pretty=format:%ai -- + pass + + # Generate a copyright + year = startYear + "-" + endYear if len(endYear) > 0 else startYear + copyright = TEMPLATE % { + "author" : author, + "year" : year + } + + # Write the copyright to the file + if copyright.encode("utf-8") != previousCopyright : + file = open(fileName, "w") + file.write(copyright.encode("utf-8")) + file.write(fileData) + file.close() + +for (path, dirs, files) in os.walk("Swiften/JID") : + if "3rdParty" in path : + continue + for filename in files : + if not filename.endswith(".cpp") and not filename.endswith(".h") : + continue + if filename.startswith("moc_") : + continue + fullFilename = path + "/" + filename + updateCopyright(fullFilename) diff --git a/tools/Copyrighter.py b/tools/Copyrighter.py deleted file mode 100755 index 189dcf5..0000000 --- a/tools/Copyrighter.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python -#coding=utf-8 - -import os, re, datetime - -TEMPLATE = """/* - * Copyright (c) %(year)s %(author)s. - * See the included COPYING file for license details. - */ - -""" - -def updateCopyright(fileName) : - file = open(fileName) - fileData = "" - - author = "" - startYear = "" - endYear = "" - previousCopyright = "" - - # Retrieve previous copyright information - header = "" - inHeader = False - inSpaceBelowHeader = False - lines = file.readlines() - lines2 = lines - for line in lines2 : - lines.pop(0) - if inSpaceBelowHeader : - if line.strip() != "" : - break - elif inHeader : - if line.startswith(" */") : - inSpaceBelowHeader = True - else : - header += line - else : - if line.strip() == "" : - continue - elif line.startswith("/*") : - inHeader = True - header += line - else : - fileData += line - break - if "Copyright" in header : - previousCopyright = header - m = re.match("\* Copyright \(c\) (?P\d\d\d\d)(-(?P\d\d\d\d))? (?P.*)", header) - if m : - author = m.group("author") - startYear = m.group("startYear") - endYear = m.group("endYear") - elif header != "" : - fileData = header - file.close() - - # Read in the rest of the data - fileData += "".join(lines) - - # Guess empty values - if author == "" : - if "Swift/" in fileName : - author = "Kevin Smith" - else : - author = u"Remko Tronçon" - if startYear == "" : - startYear = datetime.date.today().strftime("%Y") - elif endYear == "" : - ## TODO: Guess end year by looking at git log --pretty=format:%ai -- - pass - - # Generate a copyright - year = startYear + "-" + endYear if len(endYear) > 0 else startYear - copyright = TEMPLATE % { - "author" : author, - "year" : year - } - - # Write the copyright to the file - if copyright.encode("utf-8") != previousCopyright : - file = open(fileName, "w") - file.write(copyright.encode("utf-8")) - file.write(fileData) - file.close() - -for (path, dirs, files) in os.walk("Swiften/JID") : - if "3rdParty" in path : - continue - for filename in files : - if not filename.endswith(".cpp") and not filename.endswith(".h") : - continue - if filename.startswith("moc_") : - continue - fullFilename = path + "/" + filename - updateCopyright(fullFilename) diff --git a/tools/ThemeQRC.py b/tools/ThemeQRC.py deleted file mode 100755 index 63de8c3..0000000 --- a/tools/ThemeQRC.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python - -import os, sys, os.path - -print "" -print "" -for (path, dirs, files) in os.walk(sys.argv[1]) : - for file in files : - filePath = os.path.join(path,file) - print "%(path)s" % { - "alias": filePath[len(sys.argv[1])+1:], - "path": filePath - } - -print "" -print "" - -- cgit v0.10.2-6-g49f6