00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 import os
00018 import shutil
00019 import glob
00020 import makewxs
00021
00022 data = [
00023 ("docs/ClassReference-jp/html", "*.css *.gif *.png *.html *.hhc *.hhk *.hhp"),
00024 ("docs/ClassReference-en/html", "*.css *.gif *.png *.html *.hhc *.hhk *.hhp"),
00025 ("idlcompiler", "idlcompile.bat idlcompile.py"),
00026 ("OpenRTM_aist/utils/rtm-naming", "rtm-naming.py"),
00027 ("OpenRTM_aist/examples", "*.conf"),
00028 ("OpenRTM_aist/examples/AutoControl", "*.py *.conf"),
00029 ("OpenRTM_aist/examples/Composite", "*.py *.conf"),
00030 ("OpenRTM_aist/examples/ConfigSample", "*.py *.conf"),
00031 ("OpenRTM_aist/examples/ExtTrigger", "*.py *.conf"),
00032 ("OpenRTM_aist/examples/MobileRobotCanvas", "*.py *.conf"),
00033 ("OpenRTM_aist/examples/NXTRTC", "*.py *.conf"),
00034 ("OpenRTM_aist/examples/SeqIO", "*.py *.conf"),
00035 ("OpenRTM_aist/examples/SimpleIO", "*.py *.conf"),
00036 ("OpenRTM_aist/examples/SimpleService", "*.py *.conf *.idl"),
00037 ("OpenRTM_aist/examples/Slider_and_Motor", "*.py *.conf"),
00038 ("OpenRTM_aist/examples/TkJoyStick", "*.py *.conf"),
00039 ("OpenRTM_aist/examples/TkLRFViewer", "*.py *.conf"),
00040 ("OpenRTM_aist/examples/Templates", "*.py *.xml"),
00041 ("OpenRTM_aist24", "*.py"),
00042 ("OpenRTM_aist24/ext", "*.py"),
00043 ("OpenRTM_aist24/ext/sdo", "*.py"),
00044 ("OpenRTM_aist24/ext/sdo/observer", "*.py *.idl rtc.conf setup.bat"),
00045 ("OpenRTM_aist24/utils/rtcd", "rtcd.py rtcd_python.bat rtcd_python.exe rtcd.conf"),
00046 ("OpenRTM_aist24/utils/rtcprof", "rtcprof.py rtcprof_python.bat"),
00047 ("OpenRTM_aist24/utils/rtc-template", "*.py"),
00048 ("OpenRTM_aist24/RTM_IDL", "*.py *.idl *.pth"),
00049 ("OpenRTM_aist24/RTM_IDL/device_interfaces", "*.py *.idl"),
00050 ("OpenRTM_aist24/root", "*.pth"),
00051 ("OpenRTM_aist25", "*.py"),
00052 ("OpenRTM_aist25/ext", "*.py"),
00053 ("OpenRTM_aist25/ext/sdo", "*.py"),
00054 ("OpenRTM_aist25/ext/sdo/observer", "*.py *.idl rtc.conf setup.bat"),
00055 ("OpenRTM_aist25/utils/rtcd", "rtcd.py rtcd_python.bat rtcd_python.exe rtcd.conf"),
00056 ("OpenRTM_aist25/utils/rtcprof", "rtcprof.py rtcprof_python.bat"),
00057 ("OpenRTM_aist25/utils/rtc-template", "*.py"),
00058 ("OpenRTM_aist25/RTM_IDL", "*.py *.idl *.pth"),
00059 ("OpenRTM_aist25/RTM_IDL/device_interfaces", "*.py *.idl"),
00060 ("OpenRTM_aist25/root", "*.pth"),
00061 ("OpenRTM_aist26", "*.py"),
00062 ("OpenRTM_aist26/ext", "*.py"),
00063 ("OpenRTM_aist26/ext/sdo", "*.py"),
00064 ("OpenRTM_aist26/ext/sdo/observer", "*.py *.idl rtc.conf setup.bat"),
00065 ("OpenRTM_aist26/utils/rtcd", "rtcd.py rtcd_python.bat rtcd_python.exe rtcd.conf"),
00066 ("OpenRTM_aist26/utils/rtcprof", "rtcprof.py rtcprof_python.bat"),
00067 ("OpenRTM_aist26/utils/rtc-template", "*.py"),
00068 ("OpenRTM_aist26/RTM_IDL", "*.py *.idl *.pth"),
00069 ("OpenRTM_aist26/RTM_IDL/device_interfaces", "*.py *.idl"),
00070 ("OpenRTM_aist26/root", "*.pth")
00071 ]
00072
00073
00074
00075 base_dir = os.getenv("OPENRTM_PY")
00076 if base_dir == None:
00077 base_dir = "C:\\distribution\\OpenRTM-aist-Python-1.1.0\\"
00078 else:
00079 base_dir = base_dir.replace("\"", "")
00080 base_dir += "\\"
00081
00082
00083
00084 src_dir = base_dir + "OpenRTM_aist"
00085 temp_dir24 = base_dir + "OpenRTM_aist24"
00086 temp_dir25 = base_dir + "OpenRTM_aist25"
00087 temp_dir26 = base_dir + "OpenRTM_aist26"
00088 dll_list = glob.glob(base_dir + "bin\\x86_win32\\*.dll")
00089 dll_cnt = len(dll_list)
00090 if os.path.exists(temp_dir24) :
00091 shutil.rmtree(temp_dir24)
00092 if os.path.exists(temp_dir25) :
00093 shutil.rmtree(temp_dir25)
00094 if os.path.exists(temp_dir26) :
00095 shutil.rmtree(temp_dir26)
00096 shutil.copytree(src_dir, temp_dir24)
00097 shutil.copytree(src_dir, temp_dir25)
00098 shutil.copytree(src_dir, temp_dir26)
00099
00100 temp_dir24_root = base_dir + "OpenRTM_aist24\\root"
00101 temp_dir25_root = base_dir + "OpenRTM_aist25\\root"
00102 temp_dir26_root = base_dir + "OpenRTM_aist26\\root"
00103 os.mkdir(temp_dir24_root)
00104 os.mkdir(temp_dir25_root)
00105 os.mkdir(temp_dir26_root)
00106 shutil.copy2(base_dir + "OpenRTM-aist.pth", temp_dir24_root)
00107 shutil.copy2(base_dir + "OpenRTM-aist.pth", temp_dir25_root)
00108 shutil.copy2(base_dir + "OpenRTM-aist.pth", temp_dir26_root)
00109
00110
00111 def path_to_dir_id(path, prefix):
00112
00113
00114
00115 output = prefix + "_" + "_".join(path.split("/"))
00116 return output.replace(".", "_")
00117
00118 def path_to_comp_id(path, prefix):
00119
00120
00121
00122 output = prefix.capitalize()
00123 for c in path.split("/"):
00124 output += c.capitalize()
00125 return output.replace(".", "_")
00126
00127
00128
00129
00130 for (path, files) in data:
00131
00132 comp_name = path_to_comp_id(path, "rtm")
00133 comp_name = comp_name.replace("-", "")
00134
00135 dir_name = path_to_dir_id(path, "rtm")
00136
00137 path = path.replace("/", "\\")
00138
00139
00140 full_path = base_dir + "\\" + path
00141
00142 flist = []
00143 for f in files.split(" "):
00144 flist += glob.glob(full_path + "\\" + f)
00145
00146 curr_path = base_dir + path
00147 if curr_path.rfind("\\") == (len(curr_path) -1):
00148 curr_path = curr_path[0:len(curr_path)-1]
00149
00150 cmd = ["flist",
00151 "-c", comp_name,
00152 "-o", dir_name + ".yaml",
00153 "-p", curr_path]
00154 cmd += flist
00155 makewxs.main(cmd)
00156
00157
00158
00159
00160 cmd = ["wxs",
00161 "-o", "OpenRTM-aist-Python.wxs",
00162 "-i", "OpenRTM-aist-Python.wxs.in"]
00163 cmd += glob.glob("*.yaml")
00164 makewxs.main(cmd)
00165