From b76cdb25c9f724cd93c5555ac0e967a148d455dc Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 15 Dec 2011 11:06:08 +0800 Subject: refine python code --- scripts/chewing_enum.h.in | 3 --- scripts/chewing_table.h.in | 3 --- scripts/double_pinyin_table.h.in | 3 --- scripts/pinyin_parser_table.h.in | 3 --- scripts/utils.py | 5 +++++ 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 : -- cgit