The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Build with doit3

These changes was commited to the Birdfont repository Tue, 19 May 2015 07:02:27 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 19 May 2015 07:02:27 +0000 (09:02 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 19 May 2015 07:02:44 +0000 (09:02 +0200)
commit 972ff801fb464298b10274154dc78685b00ab163
tree aafc609c86d79f45f1bcfa2dd973ad2c47727b9b
parent a9b859cd391f0ca4014b467fd7b63f8c22983442
Build with doit3

scripts/bavala.py
scripts/translations.py
--- a/scripts/bavala.py +++ b/scripts/bavala.py @@ -22,25 +22,43 @@ import sys from os.path import join from doit.action import CmdAction - import config + + try: + import scripts.config as config + except ImportError: + import config + import fnmatch import subprocess def cmd(name, *args): """create string for command line""" parts = [name] + + try: + base = basestring + except NameError: + base = str + for item in args: - if isinstance(item, basestring): + if isinstance(item, base): parts.append(item) elif isinstance(item, dict): - for param, value in item.iteritems(): - if isinstance(value, basestring): + for param, value in item.items(): + if isinstance(value, base): value = [value] parts.extend('--{0} {1}'.format(param, v) for v in value) else: parts.extend(item) - return ' '.join(parts) + cmd_parts = [] + for p in parts: + if isinstance(p, str): + cmd_parts += [p] + else: + cmd_parts += [p.decode("utf-8")] + + return ' '.join(cmd_parts) def get_sources_path (folder, pattern): """obtain the path to all source files that matches pattern""" @@ -90,7 +108,7 @@ self.so_version = so_version self.so_name = 'lib' + library + '.so.' + so_version else: - self.other_vapi_files = [] + self.other_vapi_files = [] def gen_c(self, opts): """translate code from vala to C and create .vapi""" @@ -134,12 +152,12 @@ print (action) if not self.vala == []: - yield { - 'name': 'compile_c', - 'actions': [ action ], - 'file_dep': self.vala + dep_vapi, - 'targets': targets, - } + yield { + 'name': 'compile_c', + 'actions': [ action ], + 'file_dep': self.vala + dep_vapi, + 'targets': targets, + } def gen_o(self, opts): @@ -147,7 +165,7 @@ def compile_cmd(conf, opts, libs, pos): flags = [] for l in libs: - if not l == "posix" and not l == "posixtypes": + if not l == "posix" and not l == "posixtypes": process = subprocess.Popen ('pkg-config --cflags ' + l, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) cflags = process.stdout.readline() process.communicate()[0] @@ -193,7 +211,7 @@ flags += [cflags.strip ()] if generated_libs: - flags += [generated_libs] + flags += [generated_libs] return cmd(config.CC, opts, flags)
--- a/scripts/translations.py +++ b/scripts/translations.py @@ -17,7 +17,11 @@ """ import glob - from run import run + + try: + from scripts.run import run + except ImportError: + from run import run def compile_translations (): for f_name in glob.glob('po/*.po'):