14 parser = argparse.ArgumentParser(
15 description=
'A script to compile xib and storyboard.',
16 fromfile_prefix_chars=
'@')
17 parser.add_argument(
'-o',
'--output', required=
True,
18 help=
'Path to output bundle.')
19 parser.add_argument(
'-i',
'--input', required=
True,
20 help=
'Path to input xib or storyboard.')
21 parser.add_argument(
'--developer_dir', required=
False,
22 help=
'Path to Xcode.')
23 args, unknown_args = parser.parse_known_args()
25 if args.developer_dir:
26 os.environ[
'DEVELOPER_DIR'] = args.developer_dir
30 '--errors',
'--warnings',
'--notices',
31 '--output-format',
'human-readable-text'
33 ibtool_args += unknown_args
36 os.path.abspath(args.output),
37 os.path.abspath(args.input)
40 ibtool_section_re = re.compile(
r'/\*.*\*/')
41 ibtool_re = re.compile(
r'.*note:.*is clipping its content')
43 stdout = subprocess.check_output(ibtool_args).
decode(
'utf-8')
44 except subprocess.CalledProcessError
as e:
45 print(e.output.decode(
'utf-8'))
47 current_section_header =
None
48 for line
in stdout.splitlines():
49 if ibtool_section_re.match(line):
50 current_section_header = line
51 elif not ibtool_re.match(line):
52 if current_section_header:
53 print(current_section_header)
54 current_section_header =
None
59if __name__ ==
'__main__':
def print(*args, **kwargs)
static DecodeResult decode(std::string path)