Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 1 | """ Post process SWIG Bridge wrapper code Python script for Windows/LINUX/OSX platform |
| 2 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 3 | -------------------------------------------------------------------------- |
| 4 | File: finishSwigWrapperClasses.py |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 5 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 6 | Overview: Python script(s) to finish off the SWIG Python C++ Script |
| 7 | Bridge wrapper code on the Windows/LINUX/OSX platform. |
| 8 | The Python scripts are equivalent to the shell script (.sh) |
| 9 | files. |
| 10 | We use SWIG to create a C++ file containing the appropriate |
| 11 | wrapper classes and functions for each scripting language, |
| 12 | before liblldb is built (thus the C++ file can be compiled |
| 13 | into liblldb. In some cases, additional work may need to be |
| 14 | done after liblldb has been compiled, to make the scripting |
| 15 | language stuff fully functional. Any such post-processing |
| 16 | is handled through the Python scripts called here. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 17 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 18 | Environment: OS: Windows Vista or newer,LINUX,OSX. |
| 19 | IDE: Visual Studio 2013 Plugin Python Tools (PTVS) |
| 20 | Script: Python 2.6/2.7.5 x64 |
| 21 | Other: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 22 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 23 | Gotchas: None. |
| 24 | |
| 25 | Copyright: None. |
| 26 | -------------------------------------------------------------------------- |
| 27 | |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 28 | """ |
| 29 | |
| 30 | # Python modules: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 31 | import sys # Provide argument parsing |
| 32 | import os # Provide directory and file handling |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 33 | |
| 34 | # Third party modules: |
| 35 | |
| 36 | # In-house modules: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 37 | import utilsArgsParse # Parse and validate this script's input arguments |
| 38 | import utilsOsType # Determine the OS type this script is running on |
| 39 | import utilsDebug # Debug Python scripts |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 40 | |
| 41 | # Instantiations: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 42 | gbDbgVerbose = False; # True = Turn on script function tracing, False = off. |
| 43 | gbDbgFlag = False; # Global debug mode flag, set by input parameter |
| 44 | # --dbgFlag. True = operate in debug mode. |
| 45 | gbMakeFileFlag = False; # True = yes called from makefile system, False = not. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 46 | |
| 47 | # User facing text: |
| 48 | strMsgErrorNoMain = "Program called by another Python script not allowed"; |
| 49 | strExitMsgSuccess = "Program successful"; |
| 50 | strExitMsgError = "Program error: "; |
| 51 | strParameter = "Parameter: "; |
| 52 | strMsgErrorOsTypeUnknown = "Unable to determine OS type" |
| 53 | strScriptDirNotFound = "Unable to locate the script directory \'/script\'"; |
| 54 | strScriptLangsFound = "Found the following script languages:"; |
| 55 | strPostProcessError = "Executing \'%s\' post process script failed: "; |
| 56 | strScriptNotFound = "Unable to locate the post process script file \'%s\' in \'%s\'"; |
| 57 | strScriptLangFound = "Found \'%s\' build script."; |
| 58 | strScriptLangsFound = "Found the following script languages:"; |
| 59 | strExecuteMsg = "Executing \'%s\' build script..."; |
| 60 | strExecuteError = "Executing \'%s\' build script failed: "; |
| 61 | strHelpInfo = "\ |
| 62 | Python script(s) to finish off the SWIG Python C++ Script \n\ |
| 63 | Bridge wrapper code on the Windows/LINUX/OSX platform. The Python \n\ |
| 64 | scripts are equivalent to the shell script (.sh) files \n\ |
| 65 | run on others platforms.\n\ |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 66 | Args: -h (optional) Print help information on this program.\n\ |
| 67 | -d (optional) Determines whether or not this script\n\ |
| 68 | outputs additional information when running.\n\ |
| 69 | -m (optional) Specify called from Makefile system.\n\ |
| 70 | --srcRoot= The root of the lldb source tree.\n\ |
| 71 | --targetDir= Where the lldb framework/shared library gets put.\n\ |
| 72 | --cfgBldDir= (optional) Where the build-swig-Python-LLDB.py program \n\ |
| 73 | will put the lldb.py file it generated from running\n\ |
| 74 | SWIG.\n\ |
| 75 | --prefix= (optional) Is the root directory used to determine where\n\ |
| 76 | third-party modules for scripting languages should\n\ |
| 77 | be installed. Where non-Darwin systems want to put\n\ |
| 78 | the .py and .so files so that Python can find them\n\ |
| 79 | automatically. Python install directory.\n\ |
| 80 | --cmakeBuildConfiguration= (optional) Is the build configuration(Debug, Release, RelWithDebugInfo)\n\ |
| 81 | used to determine where the bin and lib directories are \n\ |
| 82 | created for a Windows build.\n\ |
| 83 | --argsFile= The args are read from a file instead of the\n\ |
| 84 | command line. Other command line args are ignored.\n\ |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 85 | \n\ |
| 86 | Usage:\n\ |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 87 | finishSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath\n\ |
| 88 | --cfgBldDir=ADirPath --prefix=ADirPath -m -d\n\ |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 89 | \n\ |
| 90 | "; #TAG_PROGRAM_HELP_INFO |
| 91 | |
| 92 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 93 | # Details: Exit the program on success. Called on program successfully done |
| 94 | # its work. Returns a status result to the caller. |
| 95 | # Args: vnResult - (R) 0 or greater indicating success. |
| 96 | # vMsg - (R) Success message if any to show success to user. |
| 97 | # Returns: None. |
| 98 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 99 | #-- |
| 100 | def program_exit_success( vnResult, vMsg ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 101 | strMsg = ""; |
| 102 | |
Ed Maste | b933fb2 | 2015-03-20 19:59:35 +0000 | [diff] [blame^] | 103 | if vMsg.__len__() != 0: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 104 | strMsg = "%s: %s (%d)" % (strExitMsgSuccess, vMsg, vnResult); |
Ed Maste | b933fb2 | 2015-03-20 19:59:35 +0000 | [diff] [blame^] | 105 | print strMsg; |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 106 | |
| 107 | sys.exit( vnResult ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 108 | |
| 109 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 110 | # Details: Exit the program with error. Called on exit program failed its |
| 111 | # task. Returns a status result to the caller. |
| 112 | # Args: vnResult - (R) A negative number indicating error condition. |
| 113 | # vMsg - (R) Error message to show to user. |
| 114 | # Returns: None. |
| 115 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 116 | #-- |
| 117 | def program_exit_on_failure( vnResult, vMsg ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 118 | print "%s%s (%d)" % (strExitMsgError, vMsg, vnResult); |
| 119 | sys.exit( vnResult ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 120 | |
| 121 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 122 | # Details: Exit the program return a exit result number and print a message. |
| 123 | # Positive numbers and zero are returned for success other error |
| 124 | # occurred. |
| 125 | # Args: vnResult - (R) A -ve (an error), 0 or +ve number (ok or status). |
| 126 | # vMsg - (R) Error message to show to user. |
| 127 | # Returns: None. |
| 128 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 129 | #-- |
| 130 | def program_exit( vnResult, vMsg ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 131 | if vnResult >= 0: |
| 132 | program_exit_success( vnResult, vMsg ); |
| 133 | else: |
| 134 | program_exit_on_failure( vnResult, vMsg ); |
| 135 | |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 136 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 137 | # Details: Dump input parameters. |
| 138 | # Args: vDictArgs - (R) Map of input args to value. |
| 139 | # Returns: None. |
| 140 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 141 | #-- |
| 142 | def print_out_input_parameters( vDictArgs ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 143 | for arg, val in vDictArgs.iteritems(): |
| 144 | strEqs = ""; |
| 145 | strQ = ""; |
| 146 | if val.__len__() != 0: |
| 147 | strEqs = " ="; |
| 148 | strQ = "\""; |
| 149 | print "%s%s%s %s%s%s\n" % (strParameter, arg, strEqs, strQ, val, strQ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 150 | |
| 151 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 152 | # Details: Validate the arguments passed to the program. This function exits |
| 153 | # the program should error with the arguments be found. |
| 154 | # Args: vArgv - (R) List of arguments and values. |
| 155 | # Returns: Int - 0 = success, -ve = some failure. |
| 156 | # Dict - Map of arguments names to argument values |
| 157 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 158 | #-- |
| 159 | def validate_arguments( vArgv ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 160 | dbg = utilsDebug.CDebugFnVerbose( "validate_arguments()" ); |
| 161 | strMsg = ""; |
| 162 | dictArgs = {}; |
| 163 | nResult = 0; |
| 164 | strListArgs = "hdm"; # Format "hiox:" = -h -i -o -x <arg> |
| 165 | listLongArgs = ["srcRoot=", "targetDir=", "cfgBldDir=", "prefix=", "cmakeBuildConfiguration=", |
| 166 | "argsFile", "buildConfig="]; |
| 167 | dictArgReq = { "-h": "o", # o = optional, m = mandatory |
| 168 | "-d": "o", |
| 169 | "-m": "o", |
| 170 | "--srcRoot": "m", |
| 171 | "--targetDir": "m", |
| 172 | "--cfgBldDir": "o", |
| 173 | "--buildConfig": "m", |
| 174 | "--prefix": "o", |
| 175 | "--cmakeBuildConfiguration": "o", |
| 176 | "--argsFile": "o" }; |
| 177 | |
| 178 | # Check for mandatory parameters |
| 179 | nResult, dictArgs, strMsg = utilsArgsParse.parse( vArgv, strListArgs, |
| 180 | listLongArgs, |
| 181 | dictArgReq, |
| 182 | strHelpInfo ); |
| 183 | if nResult < 0: |
| 184 | program_exit_on_failure( nResult, strMsg ); |
| 185 | |
| 186 | # User input -h for help |
| 187 | if nResult == 1: |
| 188 | program_exit_success( 0, strMsg ); |
| 189 | |
| 190 | return (nResult, dictArgs); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 191 | |
| 192 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 193 | # Details: Locate post process script language directory and the script within |
| 194 | # and execute. |
| 195 | # Args: vStrScriptLang - (R) Name of the script language to build. |
| 196 | # vstrFinishFileName - (R) Prefix file name to build full name. |
| 197 | # vDictArgs - (R) Program input parameters. |
| 198 | # Returns: Int - 0 = Success, < 0 some error condition. |
| 199 | # Str - Error message. |
| 200 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 201 | #-- |
| 202 | def run_post_process( vStrScriptLang, vstrFinishFileName, vDictArgs ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 203 | dbg = utilsDebug.CDebugFnVerbose( "run_post_process()" ); |
| 204 | nResult = 0; |
| 205 | strStatusMsg = ""; |
| 206 | strScriptFile = vstrFinishFileName % vStrScriptLang; |
| 207 | strScriptFileDir = "%s%s/%s" % (vDictArgs[ "--srcRoot" ], "/scripts", |
| 208 | vStrScriptLang); |
| 209 | strScriptFilePath = "%s/%s" % (strScriptFileDir, strScriptFile); |
| 210 | |
| 211 | # Check for the existence of the script file |
| 212 | strPath = os.path.normcase( strScriptFilePath ); |
| 213 | bOk = os.path.exists( strPath ); |
| 214 | if bOk == False: |
| 215 | strDir = os.path.normcase( strScriptFileDir ); |
| 216 | strStatusMsg = strScriptNotFound % (strScriptFile, strDir); |
| 217 | return (-9, strStatusMsg); |
| 218 | |
| 219 | if gbDbgFlag: |
| 220 | print strScriptLangFound % vStrScriptLang; |
| 221 | print strExecuteMsg % vStrScriptLang; |
| 222 | |
| 223 | # Change where Python looks for our modules |
| 224 | strDir = os.path.normcase( strScriptFileDir ); |
| 225 | sys.path.append( strDir ); |
| 226 | |
| 227 | # Execute the specific language script |
| 228 | dictArgs = vDictArgs; # Remove any args not required before passing on |
| 229 | strModuleName = strScriptFile[ : strScriptFile.__len__() - 3 ]; |
| 230 | module = __import__( strModuleName ); |
| 231 | nResult, strStatusMsg = module.main( dictArgs ); |
| 232 | |
| 233 | # Revert sys path |
| 234 | sys.path.remove( strDir ); |
| 235 | |
| 236 | return (nResult, strStatusMsg); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 237 | |
| 238 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 239 | # Details: Step through each script language sub directory supported |
| 240 | # and execute post processing script for each scripting language, |
| 241 | # make sure the build script for that language exists. |
| 242 | # For now the only language we support is Python, but we expect this |
| 243 | # to change. |
| 244 | # Args: vDictArgs - (R) Program input parameters. |
| 245 | # Returns: Int - 0 = Success, < 0 some error condition. |
| 246 | # Str - Error message. |
| 247 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 248 | #-- |
| 249 | def run_post_process_for_each_script_supported( vDictArgs ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 250 | dbg = utilsDebug.CDebugFnVerbose( "run_post_process_for_each_script_supported()" ); |
| 251 | nResult = 0; |
| 252 | strStatusMsg = ""; |
| 253 | strScriptDir = vDictArgs[ "--srcRoot" ] + "/scripts"; |
| 254 | strFinishFileName = "finishSwig%sLLDB.py"; |
| 255 | |
| 256 | # Check for the existence of the scripts folder |
| 257 | strScriptsDir = os.path.normcase( strScriptDir ); |
| 258 | bOk = os.path.exists( strScriptsDir ); |
| 259 | if bOk == False: |
| 260 | return (-8, strScriptDirNotFound); |
| 261 | |
| 262 | # Look for any script language directories to build for |
| 263 | listDirs = []; |
| 264 | nDepth = 1; |
| 265 | for strPath, listDirs, listFiles in os.walk( strScriptDir ): |
| 266 | nDepth = nDepth - 1; |
| 267 | if nDepth == 0: |
| 268 | break; |
| 269 | |
| 270 | if gbDbgFlag: |
| 271 | print strScriptLangsFound, |
| 272 | for dir in listDirs: |
| 273 | print dir, |
| 274 | print "\n"; |
| 275 | |
| 276 | # Iterate script directory find any script language directories |
| 277 | for scriptLang in listDirs: |
| 278 | dbg.dump_text( "Executing language script for \'%s\'" % scriptLang ); |
| 279 | nResult, strStatusMsg = run_post_process( scriptLang, strFinishFileName, |
| 280 | vDictArgs ); |
| 281 | if nResult < 0: |
| 282 | break; |
| 283 | |
| 284 | if nResult < 0: |
| 285 | strTmp = strPostProcessError % scriptLang; |
| 286 | strTmp += strStatusMsg; |
| 287 | strStatusMsg = strTmp; |
| 288 | |
| 289 | return (nResult, strStatusMsg); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 290 | |
| 291 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 292 | # Details: Program's main() with arguments passed in from the command line. |
| 293 | # Program either exits normally or with error from this function - |
| 294 | # top most level function. |
| 295 | # Args: vArgv - (R) List of arguments and values. |
| 296 | # Returns: None |
| 297 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 298 | #-- |
| 299 | def main( vArgv ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 300 | dbg = utilsDebug.CDebugFnVerbose( "main()" ); |
| 301 | bOk = False; |
| 302 | dictArgs = {}; |
| 303 | nResult = 0; |
| 304 | strMsg = ""; |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 305 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 306 | # The validate arguments fn will exit the program if tests fail |
| 307 | nResult, dictArgs = validate_arguments( vArgv ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 308 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 309 | eOSType = utilsOsType.determine_os_type(); |
| 310 | if eOSType == utilsOsType.EnumOsType.Unknown: |
| 311 | program_exit( -4, strMsgErrorOsTypeUnknown ); |
| 312 | |
| 313 | global gbDbgFlag; |
| 314 | gbDbgFlag = dictArgs.has_key( "-d" ); |
| 315 | if gbDbgFlag: |
| 316 | print_out_input_parameters( dictArgs ); |
| 317 | |
| 318 | # Check to see if we were called from the Makefile system. If we were, check |
| 319 | # if the caller wants SWIG to generate a dependency file. |
| 320 | # Not used in this program, but passed through to the language script file |
| 321 | # called by this program |
| 322 | global gbMakeFileFlag; |
| 323 | gbMakeFileFlag = dictArgs.has_key( "-m" ); |
| 324 | |
| 325 | nResult, strMsg = run_post_process_for_each_script_supported( dictArgs ); |
| 326 | |
| 327 | program_exit( nResult, strMsg ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 328 | |
| 329 | #----------------------------------------------------------------------------- |
| 330 | #----------------------------------------------------------------------------- |
| 331 | #----------------------------------------------------------------------------- |
| 332 | |
| 333 | #TAG_PROGRAM_HELP_INFO |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 334 | """ Details: Program main entry point. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 335 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 336 | -------------------------------------------------------------------------- |
| 337 | Args: -h (optional) Print help information on this program. |
| 338 | -d (optional) Determines whether or not this script |
| 339 | outputs additional information when running. |
| 340 | -m (optional) Specify called from Makefile system. If given locate |
| 341 | the LLDBWrapPython.cpp in --srcRoot/source folder |
| 342 | else in the --targetDir folder. |
| 343 | --srcRoot= The root of the lldb source tree. |
| 344 | --targetDir= Where the lldb framework/shared library gets put. |
| 345 | --cfgBldDir= Where the buildSwigPythonLLDB.py program will |
| 346 | (optional) put the lldb.py file it generated from running |
| 347 | SWIG. |
| 348 | --prefix= Is the root directory used to determine where |
| 349 | (optional) third-party modules for scripting languages should |
| 350 | be installed. Where non-Darwin systems want to put |
| 351 | the .py and .so files so that Python can find them |
| 352 | automatically. Python install directory. |
| 353 | --cmakeBuildConfiguration= (optional) Is the build configuration(Debug, Release, RelWithDebugInfo)\n\ |
| 354 | used to determine where the bin and lib directories are \n\ |
| 355 | created for a Windows build.\n\ |
| 356 | --argsFile= The args are read from a file instead of the |
| 357 | command line. Other command line args are ignored. |
| 358 | Usage: |
| 359 | finishSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath |
| 360 | --cfgBldDir=ADirPath --prefix=ADirPath -m -d |
| 361 | |
| 362 | Results: 0 Success |
| 363 | -1 Error - invalid parameters passed. |
| 364 | -2 Error - incorrect number of mandatory parameters passed. |
| 365 | |
| 366 | -4 Error - unable to determine OS type. |
| 367 | -5 Error - program not run with name of "__main__". |
| 368 | -8 Error - unable to locate the scripts folder. |
| 369 | -9 Error - unable to locate the post process language script |
| 370 | file. |
| 371 | |
| 372 | -100+ - Error messages from the child language script file. |
| 373 | |
| 374 | -------------------------------------------------------------------------- |
| 375 | |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 376 | """ |
| 377 | |
| 378 | # Called using "__main__" when not imported i.e. from the command line |
| 379 | if __name__ == "__main__": |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 380 | utilsDebug.CDebugFnVerbose.bVerboseOn = gbDbgVerbose; |
| 381 | dbg = utilsDebug.CDebugFnVerbose( "__main__" ); |
| 382 | main( sys.argv[ 1: ] ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 383 | else: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 384 | program_exit( -5, strMsgErrorNoMain ); |
| 385 | |