[geneagrapher] 67/226: Script to run before packaging. It adds a copy of the license to the top of the defined list of files.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sat Jul 11 17:10:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository geneagrapher.

commit 8f4688a5c446bd657a1c1aa30eae5a807a8474d1
Author: David Alber <alber.david at gmail.com>
Date:   Mon Sep 29 06:01:42 2008 +0000

    Script to run before packaging. It adds a copy of the license to the top of the defined list of files.
---
 Geneagrapher/licensify.py | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/Geneagrapher/licensify.py b/Geneagrapher/licensify.py
new file mode 100644
index 0000000..a46051a
--- /dev/null
+++ b/Geneagrapher/licensify.py
@@ -0,0 +1,33 @@
+"""This small tool copies the license text in the file defined in the
+'license' variable below to the top of each file defined in the
+'files' variable. The license is prepended by the comment character.
+
+This script is meant to be called before packaging."""
+
+import sys
+
+def prependLicense(file, license):
+    res = ''
+
+    lin = open(license, 'r')
+    for line in lin:
+        res = '%s# %s' % (res, line)
+    lin.close()
+    res = '%s\n' % (res)
+
+    fin = open(file, 'r')
+    for line in fin:
+        res = '%s%s' % (res, line)
+
+    fin.close()
+    return res
+
+if __name__ == '__main__':
+    files = ['geneagrapher/GGraph.py', 'geneagrapher/geneagrapher.py',
+             'geneagrapher/grab.py', 'geneagrapher/ggrapher.py']
+    license = 'COPYING'
+    for file in files:
+        res = prependLicense(file, license)
+        fout = open(file, "w")
+        fout.write(res)
+        fout.close()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/geneagrapher.git



More information about the debian-science-commits mailing list