[openrtm-commit:01073] r573 - trunk/OpenRTM-aist-Python

openrtm @ openrtm.org openrtm @ openrtm.org
2013年 5月 2日 (木) 18:43:28 JST


Author: n-ando
Date: 2013-05-02 18:43:28 +0900 (Thu, 02 May 2013)
New Revision: 573

Modified:
   trunk/OpenRTM-aist-Python/setup.py
Log:
[compat] OpenRTM-aist.pth is now installed. Directory names have been changed: docs->doc examples->example

Modified: trunk/OpenRTM-aist-Python/setup.py
===================================================================
--- trunk/OpenRTM-aist-Python/setup.py	2013-05-01 12:07:28 UTC (rev 572)
+++ trunk/OpenRTM-aist-Python/setup.py	2013-05-02 09:43:28 UTC (rev 573)
@@ -214,14 +214,12 @@
 # scripts settings
 #
 pkg_scripts_unix  = ['OpenRTM_aist/utils/rtcd/rtcd_python',
-                     'OpenRTM_aist/utils/rtcprof/rtcprof_python',
-                     'OpenRTM_aist/ext/sdo/observer/setup.bat']
+                     'OpenRTM_aist/utils/rtcprof/rtcprof_python']
 pkg_scripts_win32 = ['OpenRTM_aist/utils/rtcd/rtcd.py',
                      'OpenRTM_aist/utils/rtcd/rtcd_python.exe',
                      'OpenRTM_aist/utils/rtcd/rtcd_python.bat',
                      'OpenRTM_aist/utils/rtcprof/rtcprof_python.py',
-                     'OpenRTM_aist/utils/rtcprof/rtcprof_python.bat',
-                     'OpenRTM_aist/ext/sdo/observer/setup.bat']
+                     'OpenRTM_aist/utils/rtcprof/rtcprof_python.bat']
 #
 # ext modules
 #
@@ -233,14 +231,14 @@
 # examples
 #
 example_dir           = "OpenRTM_aist/examples"
-target_example_dir    = "share/openrtm-" + pkg_shortver + "/examples/python"
+target_example_dir    = "share/openrtm-" + pkg_shortver + "/example/python"
 example_match_regex   = ".*\.(py|conf|sh|xml|idl)$"
 example_path          = os.path.normpath(current_dir + "/" + example_dir)
 #
 # documents
 #
 document_dir          = "OpenRTM_aist/docs"
-target_doc_dir        = "share/openrtm-" + pkg_shortver + "/docs/python"
+target_doc_dir        = "share/openrtm-" + pkg_shortver + "/doc/python"
 document_match_regex  = ".*\.(css|gif|png|html||hhc|hhk|hhp)$"
 document_path         = os.path.normpath(current_dir + "/" + document_dir)
 
@@ -555,7 +553,22 @@
     current_dir = baseidl_path
     idl_files   = [os.path.join(baseidl_path, f) for f in baseidl_files]
     compile_idl(self.omniidl, include_dirs, current_dir, idl_files)
+    self.run_command("build_py")
 
+from distutils.command.build_py import build_py as _build_py
+class build_py(_build_py):
+  """
+  This class is a subcommand of build_core command. The command copies
+  modules into build directory.
+  # This class was created for only copying OpenRTM-aist.pth file
+  """
+  description = "Copying pure python modules into build directory."
+  def run(self):
+    _build_py.run(self)
+    # copying OpenRTM-aist.pth file
+    self.copy_file(os.path.join(".", "OpenRTM-aist.pth"), self.build_lib,
+                   preserve_mode=False)
+
 #------------------------------------------------------------
 # "build_example" sub command
 #------------------------------------------------------------
@@ -692,6 +705,7 @@
     return
   def run(self):
     remove_stubs(baseidl_path, baseidl_files, baseidl_mods)
+    remove_dirs('.', ["build"])
     remove_dirs('.', ["dist"])
     remove_files('.', ["MANIFEST"])
 
@@ -907,8 +921,13 @@
 # IDL file list
 #
 pkg_package_data_files = {
-  'OpenRTM_aist': ['RTM_IDL/*.idl'],
-  'OpenRTM_aist': ['RTM_IDL/device_interfaces/*.idl']
+  'OpenRTM_aist': ['RTM_IDL/*.idl',
+                   'RTM_IDL/device_interfaces/*.idl',
+                   'ext/sdo/observer/*.conf',
+                   'ext/sdo/observer/*.bat',
+                   'ext/sdo/observer/*.sh',
+                   'ext/sdo/observer/*.idl',
+                   ],
   }
 #
 # scripts
@@ -917,17 +936,6 @@
   pkg_scripts = pkg_scripts_win32
 else:
   pkg_scripts = pkg_scripts_unix
-#
-# ext modules
-#
-if os_is() == "win32":
-  ext_match_regex = ext_match_regex_win32
-else:
-  ext_match_regex = ext_match_regex_unix
-  pkg_ext_files = create_filelist(ext_dir,
-                                  "OpenRTM_aist/",
-                                  target_ext_dir,
-                                  ext_match_regex)
 
 #
 # example file list -> MyDistribution.example_files
@@ -965,6 +973,7 @@
            distclass        = MyDistribution,
            cmdclass         = { "build": build_all,
                                 "build_core": build_core,
+                                "build_py": build_py,
                                 "build_example": build_example,
                                 "build_doc": build_doc,
                                 "clean": clean_all,



More information about the openrtm-commit mailing list