refine python code
authorPeng Wu <alexepico@gmail.com>
Thu, 15 Dec 2011 03:06:08 +0000 (11:06 +0800)
committerPeng Wu <alexepico@gmail.com>
Thu, 15 Dec 2011 03:06:08 +0000 (11:06 +0800)
scripts/chewing_enum.h.in
scripts/chewing_table.h.in
scripts/double_pinyin_table.h.in
scripts/pinyin_parser_table.h.in
scripts/utils.py

index 7280b65..46072df 100644 (file)
@@ -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
 
index ac01a3a..16a05b7 100644 (file)
@@ -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
 
index 7ad1abc..15a8ee9 100644 (file)
@@ -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
 
index 4af0b4b..17f5615 100644 (file)
@@ -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
 
index 77eecbe..391e54f 100644 (file)
 
 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 :