1 # -*- coding: utf-8 -*-
2 # vim:set et sts=4 sw=4:
4 # libpinyin - Library to deal with pinyin.
6 # Copyright (C) 2011 Peng Wu <alexepico@gmail.com>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 header = '''/* This file is generated by python scripts. Don't edit this file directly.
29 def expand_file(filename, get_table_content):
30 infile = open(filename, "r")
32 for line in infile.readlines():
33 line = line.rstrip(os.linesep)
37 if line[0] == '@' and line[-1] == '@':
38 tablename = line[1:-1]
39 print(get_table_content(tablename))