Lines Matching +full:- +full:print +full:- +full:file +full:- +full:name
1 #!/usr/bin/python -B
6 # Copyright (C) 2013-2014 IBM Corporation and Others. All Rights Reserved.
8 print("NOTE: this tool is a TECHNOLOGY PREVIEW and not a supported ICU tool.")
10 # @author Steven R. Loomis <srl@icu-project.org>
19 ##$ rm -rf ./out
20 ##$ bldicures.py --name myapp --from ./loc -d ./out
23 # use 'bldicures.py --help' for help.
36 # for utf-8
38 #sys.setdefaultencoding("utf-8")
45 … ICU Resource Builder', epilog='ICU tool, http://icu-project.org - master copy at http://source.ic…
46 parser.add_argument('-f', '--from', action='append', dest='fromdirs', help='read .txt files from th…
47 parser.add_argument('-n', '--name', action='store', help='set the bundle name, such as "myapp"', me…
48 parser.add_argument('-m', '--mode', action='store', help='pkgdata mode', metavar='mode', default="a…
49 parser.add_argument('-d', '--dest', action='store', dest='destdir', help='dest dir, default is ".".…
50 parser.add_argument('-e', '--endian', action='store', dest='endian', help='endian, big, little or h…
51 parser.add_argument('--verbose', '-v', action='count',default=0)
55 print("Options: "+str(args))
58 print("mkdir " + args.destdir)
68 print("Unknown endianness: %s" % args.endian)
77 print("Don't know how to do swapping for mode=%s" % args.mode)
86 print(">%s" % (listname))
89 print('# list for "%s" generated by %s on %s' % (args.name,parser.prog, '(now)'), file = listfn)
90 print('# args: ' + str(args), file = listfn)
91 print('#', file = listfn)
95 print("""// Warning, this file is autogenerated by %s
97 InstalledLocales:table {""" % (parser.prog), file = idxfn)
103 print("+ %s (from %s)" % (loc, txtname))
104 print("# %s" % (txtname), file = listfn)
105 print("%s.res" % (loc), file = listfn)
113 print(" %s {\"\"}" % loc, file = idxfn)
118 print("Collecting .txt files in %s" % (dir))
124 print(junk)
125 if (path.find("/.svn") != -1):
127 for file in files:
128 if (file[-4:] != ".txt"):
130 print("Ignoring %s/%s with suffix %s" % (path,file, file[-4:]))
132 loc = file[:-4]
135 print(" }", file = idxfn)
136 print("}", file = idxfn)
142 print(gens)
145 print("TODO: dependency tracking. For now, don't care")
149 cmd = 'genrb -d "%s/%s" "%s"' % (args.destdir, tmpdir, item["txt"])
151 print("# " + cmd)
154 cmd = 'pkgdata -m "%s" -T "%s/%s" -p "%s" -s "%s/%s" -d "%s" "%s"' % (pkgmode,args.destdir,tmpdir,a…
156 cmd = cmd + " -v"
157 print("# " + cmd)
160 print("# Command failed: " + cmd)
164 outfile = "%s/%s.dat" % (args.destdir, args.name)
165 tmpfile = "%s/%s/%s.dat" % (args.destdir, tmpdir, args.name)
167 print("# %s -> %s" % (outfile, tmpfile))
170 cmd = 'icupkg -w -tb "%s" "%s"' % (tmpfile, outfile)
172 cmd = cmd + " -v"
173 print("# " + cmd)
176 print("# Swap command failed: " + cmd)
180 os.mkdir("%s/%s/" % (args.destdir, args.name))
182 cmd = 'icupkg -tb -x "%s" -d "%s/%s/" "%s"' % (listname, args.destdir, args.name, outfile)
184 cmd = cmd + " -v"
185 print("# " + cmd)
188 print("# Swap command failed: " + cmd)