7 Copyright (C) 2009-2014     9     RT-Synthesis Research Group    10     Intelligent Systems Research Institute,    11     National Institute of Advanced Industrial Science and Technology (AIST),    14 Licensed under the Eclipse Public License -v 1.0 (EPL)    15 http://www.opensource.org/licenses/eclipse-1.0.txt    17 rtctree install script.    22 from distutils 
import errors
    23 from distutils 
import log
    24 from distutils 
import util
    25 from distutils.cmd 
import Command
    26 from distutils.core 
import setup
    27 from distutils.command 
import build
    35     '''Generate IDL file name from directory prefix and IDL module name.'''    36     return os.path.join(dir, name + 
'.idl')
    40     '''Implemented the build IDL subcommand.'''    42     description = 
'Generate Python stubs from IDL files'    44     user_options = [(
'omniidl=', 
'i', 
'omniidl program used to build stubs'),
    45                     (
'idldir=',  
'd', 
'directory where IDL files reside')
    52         self.
idl_files = [
'BasicDataType', 
'ComponentObserver',
    53                 'ExtendedDataTypes', 
'InterfaceDataTypes', 
'DataPort',
    54                 'Logger', 
'Manager', 
'OpenRTM', 
'RTC', 
'SDOPackage']
    60             self.
idl_dir = os.path.join(os.getcwd(), 
'rtctree', 
'rtmidl')
    63         log.info(
'{0} {1} {2}'.format(cmd, 
' '.join(params), 
' '.join(files)))
    64         process = subprocess.Popen([cmd] + params + files,
    65                 stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
    67         stdout, stderr = process.communicate()
    69         if process.returncode != 0:
    70             raise errors.DistutilsExecError(
'Error compiling IDL \    71 ({0})'.format(process.returncode))
    78                      msg=
'Generating python stubs from IDL files')
    83         return self.distribution.has_pure_modules()
    86         return self.distribution.has_c_libraries()
    89         return self.distribution.has_ext_modules()
    92         return self.distribution.has_scripts()
    97     sub_commands = [(
'build_idl', has_idl_files),
    98                     (
'build_py', has_pure_modules),
    99                     (
'build_clib', has_c_libraries),
   100                     (
'build_ext', has_ext_modules),
   101                     (
'build_scripts', has_scripts)
   107       description=
'API for interacting with running RT Components and \   108 managing RTM-based systems.',
   109       long_description=
'API for interacting with running RT Components and \   110 managing RTM-based systems.',
   111       author=
'Geoffrey Biggs',
   112       author_email=
'git@killbots.net',
   113       url=
'http://github.com/gbiggs/rtctree',
   116           'Development Status :: 5 - Production/Stable',
   117           'Intended Audience :: Developers',
   118           'License :: OSI Approved :: EPL License',
   119           'Natural Language :: English',
   120           'Operating System :: OS Independent',
   121           'Programming Language :: Python :: 2.6',
   122           'Programming Language :: Python :: 2.7',
   123           'Topic :: Software Development',
   127                 'rtctree.rtmidl.OpenRTM',
   128                 'rtctree.rtmidl.OpenRTM__POA',
   129                 'rtctree.rtmidl.RTC',
   130                 'rtctree.rtmidl.RTC__POA',
   131                 'rtctree.rtmidl.RTM',
   132                 'rtctree.rtmidl.RTM__POA',
   133                 'rtctree.rtmidl.SDOPackage',
   134                 'rtctree.rtmidl.SDOPackage__POA'],
   135       cmdclass={
'build':CustomBuild, 
'build_idl': BuildIDL}
 def has_c_libraries(self)
def has_ext_modules(self)
def has_pure_modules(self)
def finalize_options(self)
def compile_idl(self, cmd, params, files)
def initialize_options(self)
def gen_idl_name(dir, name)