summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-12-15 11:06:08 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-15 11:06:08 +0800
commitb76cdb25c9f724cd93c5555ac0e967a148d455dc (patch)
tree394391c63c9f1ca4b87ae09d3dd2ab0567e3816d
parent8f6d32826c67dde615157aba21dbfdcdf4d479c7 (diff)
downloadlibpinyin-b76cdb25c9f724cd93c5555ac0e967a148d455dc.tar.gz
libpinyin-b76cdb25c9f724cd93c5555ac0e967a148d455dc.tar.xz
libpinyin-b76cdb25c9f724cd93c5555ac0e967a148d455dc.zip
refine python code
-rw-r--r--scripts/chewing_enum.h.in3
-rw-r--r--scripts/chewing_table.h.in3
-rw-r--r--scripts/double_pinyin_table.h.in3
-rw-r--r--scripts/pinyin_parser_table.h.in3
-rw-r--r--scripts/utils.py5
5 files changed, 5 insertions, 12 deletions
diff --git a/scripts/chewing_enum.h.in b/scripts/chewing_enum.h.in
index 7280b65..46072df 100644
--- a/scripts/chewing_enum.h.in
+++ b/scripts/chewing_enum.h.in
@@ -1,6 +1,3 @@
-/* This file is generated by python scripts. Don't edit this file directly.
- */
-
#ifndef CHEWING_ENUM_H
#define CHEWING_ENUM_H
diff --git a/scripts/chewing_table.h.in b/scripts/chewing_table.h.in
index ac01a3a..16a05b7 100644
--- a/scripts/chewing_table.h.in
+++ b/scripts/chewing_table.h.in
@@ -1,6 +1,3 @@
-/* This file is generated by python scripts. Don't edit this file directly.
- */
-
#ifndef CHEWING_TABLE_H
#define CHEWING_TABLE_H
diff --git a/scripts/double_pinyin_table.h.in b/scripts/double_pinyin_table.h.in
index 7ad1abc..15a8ee9 100644
--- a/scripts/double_pinyin_table.h.in
+++ b/scripts/double_pinyin_table.h.in
@@ -1,6 +1,3 @@
-/* This file is generated by python scripts. Don't edit this file directly.
- */
-
#ifndef DOUBLE_PINYIN_TABLE_H
#define DOUBLE_PINYIN_TABLE_H
diff --git a/scripts/pinyin_parser_table.h.in b/scripts/pinyin_parser_table.h.in
index 4af0b4b..17f5615 100644
--- a/scripts/pinyin_parser_table.h.in
+++ b/scripts/pinyin_parser_table.h.in
@@ -1,6 +1,3 @@
-/* This file is generated by python scripts. Don't edit this file directly.
- */
-
#ifndef PINYIN_PARSER_TABLE_H
#define PINYIN_PARSER_TABLE_H
diff --git a/scripts/utils.py b/scripts/utils.py
index 77eecbe..391e54f 100644
--- a/scripts/utils.py
+++ b/scripts/utils.py
@@ -22,8 +22,13 @@
import os
+header = '''/* This file is generated by python scripts. Don't edit this file directly.
+ */
+'''
+
def expand_file(filename, get_table_content):
infile = open(filename, "r")
+ print(header)
for line in infile.readlines():
line = line.rstrip(os.linesep)
if len(line) < 3 :