openrtpwxs.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # @brief WiX wxs file generator for omniORB
4 # @date $Date$
5 # @author Norkai Ando <n-ando@aist.go.jp>
6 #
7 # Copyright (C) 2010
8 # Noriaki Ando
9 # Intelligent Systems Research Institute,
10 # National Institute of
11 # Advanced Industrial Science and Technology (AIST), Japan
12 # All rights reserved.
13 #
14 # $Id$
15 #
16 
17 data = [
18  ("", "*.jar *.exe .eclipseproduct"),
19  ("configuration", "*.ini *.jar"),
20  ("plugins", "*.jar"),
21 ]
22 
23 import os
24 base_dir=os.getenv("RTSE_ROOT")
25 
26 if base_dir == None:
27  base_dir="C:\\distribution\\OpenRTP\\RTSystemEditor"
28 else:
29  base_dir = base_dir.replace("\"", "")
30  base_dir += "\\"
31 
32 def path_to_dir_id(path, prefix):
33  # path = "bin/x86_win32" prefix = "omni"
34  # output = "omni_bin_x86_win32"
35  # "." -> "_"
36  output = prefix + "_" + "_".join(path.split("/"))
37  return output.replace(".", "_")
38 
39 
40 def path_to_comp_id(path, prefix):
41  # path = "bin/x86_win32" prefix = "omni"
42  # output = "OmniBinX86_win32"
43  # "." -> "_"
44  output = prefix.capitalize()
45  for c in path.split("/"):
46  output += c.capitalize()
47  return output.replace(".", "_")
48 
49 import makewxs
50 
51 for (path, files) in data:
52  # wxs component name
53  comp_name = path_to_comp_id(path, "openrtp")
54  # wxs directory name
55  dir_name = path_to_dir_id(path, "openrtp")
56 
57  path = path.replace("/", "\\")
58 
59  # full path to target directory
60  full_path = base_dir + "\\" + path
61 
62  import glob
63  flist = []
64  for f in files.split(" "):
65  flist += glob.glob(full_path + "\\" + f)
66 
67  cmd = ["flist",
68  "-c", comp_name,
69  "-o", dir_name + ".yaml",
70  "-p", base_dir + path]
71  cmd += flist
72 
73  makewxs.main(cmd)
74 
75 
76 cmd = ["wxs",
77  "-o", "OpenRTP_inc.wxs",
78  "-i", "OpenRTP_inc.wxs.in"]
79 cmd += glob.glob("*.yaml")
80 makewxs.main(cmd)
def path_to_comp_id(path, prefix)
Definition: openrtpwxs.py:40
def path_to_dir_id(path, prefix)
Definition: openrtpwxs.py:32
def main(argv)
Definition: makewxs.py:157


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Mon Feb 28 2022 23:01:06