summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2010-05-20 12:49:05 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2010-05-20 12:49:05 +0800
commitb1a91ad39f89efcaeb7bd01c3877b7fea0e6d1c7 (patch)
tree65b9d418979fb2774359b9e675949dee9d42dda3 /scripts
parentd52ce00ad6718933db0df16451a8ea0a9e15e505 (diff)
downloadibus-libpinyin-b1a91ad39f89efcaeb7bd01c3877b7fea0e6d1c7.tar.gz
Add copyright header
Diffstat (limited to 'scripts')
-rw-r--r--scripts/addheader.py24
-rw-r--r--scripts/header20
2 files changed, 44 insertions, 0 deletions
diff --git a/scripts/addheader.py b/scripts/addheader.py
new file mode 100644
index 0000000..09e628e
--- /dev/null
+++ b/scripts/addheader.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+import sys
+
+def add_header(name, header):
+ with file(name) as fin:
+ lines = fin.readlines()
+ with file(name, "w") as fout:
+ for l in header:
+ print >> fout, l,
+ if lines[0].startswith("/*") and lines[0].endswith("*/\n"):
+ pass
+ else:
+ print >> fout, lines[0],
+ for l in lines[1:]:
+ print >> fout, l,
+
+def main():
+ with file("header") as f:
+ header = f.readlines()
+ for name in sys.argv[1:]:
+ add_header(name, header)
+
+if __name__ == "__main__":
+ main()
diff --git a/scripts/header b/scripts/header
new file mode 100644
index 0000000..4148767
--- /dev/null
+++ b/scripts/header
@@ -0,0 +1,20 @@
+/* vim:set et ts=4 sts=4:
+ *
+ * ibus-pinyin - The Chinese PinYin engine for IBus
+ *
+ * Copyright (c) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */