The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

configfile.py in scripts

This file is a part of the Birdfont project.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git

Revisions

View the latest version of scripts/configfile.py.
Don't merge empty paths
1 #!/usr/bin/python 2 """ 3 Copyright (C) 2012, 2013 Eduardo Naufel Schettino and Johan Mattsson 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 """ 18 19 import version 20 import time; 21 from time import gmtime, strftime 22 23 VERSION = version.VERSION 24 25 def write_config (prefix): 26 print ("Writing Config.vala") 27 28 vars = (('VERSION', VERSION), 29 ('BUILD_TIMESTAMP', strftime("%Y-%m-%d %H:%M:%S +0000", gmtime())), 30 ('PREFIX', prefix), 31 ) 32 33 f = open('./libbirdfont/Config.vala', 'w+') 34 f.write("// Don't edit this file -- it is generated by the build script\n") 35 f.write("namespace BirdFont {\n") 36 37 var_line = ' internal static const string %s = "%s";\n' 38 for name, value in vars: 39 f.write(var_line % (name, value)) 40 41 f.write("}") 42 43 def write_compile_parameters (prefix, dest, cc, gee, posixvala): 44 f = open('./scripts/config.py', 'w+') 45 f.write("#!/usr/bin/python\n") 46 f.write("PREFIX = \"" + prefix + "\"\n") 47 f.write("DEST = \"" + dest + "\"\n") 48 f.write("CC = \"" + cc + "\"\n") 49 f.write("GEE = \"" + gee + "\"\n") 50 f.write("POSIXVALA = " + posixvala + "\n") 51 52 53