26 token0 = text.split(
"__GUID__")
28 for i
in range(1, len(token0)):
30 text0 += u + token0[i]
32 token1 = text0.split(
"__UUID")
34 for i
in range(1, len(token1)):
36 text1 += u + token1[i]
59 if path[-1] !=
"\\" or path[-1] !=
"/":
65 out.append(os.path.basename(f))
70 name, ext = fname.rsplit(
".", 1)
74 if name !=
None and len(name) > 8:
75 short_name = name[:5] + self.
sn_num(name[:5])
78 if ext !=
None and len(ext) > 3:
84 return short_name +
"." + short_ext
91 if self.shortnames.has_key(name):
98 if self.shortext.has_key(ext):
102 return "%01d" % (self.
shortext[ext])
108 return text.replace(
"\\",
"\\\\")
112 for fname
in self.
files:
127 fd = open(template,
'r') 138 return yaml.load(yaml_text)
142 of.write(self.template.generate(self.
dict))
147 print """makewxs.py cmd options 149 flist: make file list to be included wxs file 150 wxs : make wxs file from a input template file and yaml files 152 makewxs.py flist -c ComponentName -p Path -o OutputFilename file_names... 153 makewxs.py wxs -o Output.wxs -i InputTempalte input_yaml_files... 165 opts, args = getopt.getopt(argv[1:],
"c:p:o:", [])
185 opts, args = getopt.getopt(argv[1:],
"o:i:", [])
195 wxs =
make_wxs(outfile, infile, args)
203 if __name__ ==
"__main__":
def __init__(self, outfile, infile, yaml_files)
def uuid1(node=None, clock_seq=None)
def __init__(self, comp, path, files)
def load_template(self, template)
def check_path(self, path)
def to_basename(self, files)
def load_yaml(self, yaml_files)
def to_shortname(self, fname)