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 | |
| 103 | if vMsg.__len__() == 0: |
| 104 | strMsg = "%s (%d)" % (strExitMsgSuccess, vnResult); |
| 105 | else: |
| 106 | strMsg = "%s: %s (%d)" % (strExitMsgSuccess, vMsg, vnResult); |
| 107 | print strMsg; |
| 108 | |
| 109 | sys.exit( vnResult ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 110 | |
| 111 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 112 | # Details: Exit the program with error. Called on exit program failed its |
| 113 | # task. Returns a status result to the caller. |
| 114 | # Args: vnResult - (R) A negative number indicating error condition. |
| 115 | # vMsg - (R) Error message to show to user. |
| 116 | # Returns: None. |
| 117 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 118 | #-- |
| 119 | def program_exit_on_failure( vnResult, vMsg ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 120 | print "%s%s (%d)" % (strExitMsgError, vMsg, vnResult); |
| 121 | sys.exit( vnResult ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 122 | |
| 123 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 124 | # Details: Exit the program return a exit result number and print a message. |
| 125 | # Positive numbers and zero are returned for success other error |
| 126 | # occurred. |
| 127 | # Args: vnResult - (R) A -ve (an error), 0 or +ve number (ok or status). |
| 128 | # vMsg - (R) Error message to show to user. |
| 129 | # Returns: None. |
| 130 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 131 | #-- |
| 132 | def program_exit( vnResult, vMsg ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 133 | if vnResult >= 0: |
| 134 | program_exit_success( vnResult, vMsg ); |
| 135 | else: |
| 136 | program_exit_on_failure( vnResult, vMsg ); |
| 137 | |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 138 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 139 | # Details: Dump input parameters. |
| 140 | # Args: vDictArgs - (R) Map of input args to value. |
| 141 | # Returns: None. |
| 142 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 143 | #-- |
| 144 | def print_out_input_parameters( vDictArgs ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 145 | for arg, val in vDictArgs.iteritems(): |
| 146 | strEqs = ""; |
| 147 | strQ = ""; |
| 148 | if val.__len__() != 0: |
| 149 | strEqs = " ="; |
| 150 | strQ = "\""; |
| 151 | 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] | 152 | |
| 153 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 154 | # Details: Validate the arguments passed to the program. This function exits |
| 155 | # the program should error with the arguments be found. |
| 156 | # Args: vArgv - (R) List of arguments and values. |
| 157 | # Returns: Int - 0 = success, -ve = some failure. |
| 158 | # Dict - Map of arguments names to argument values |
| 159 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 160 | #-- |
| 161 | def validate_arguments( vArgv ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 162 | dbg = utilsDebug.CDebugFnVerbose( "validate_arguments()" ); |
| 163 | strMsg = ""; |
| 164 | dictArgs = {}; |
| 165 | nResult = 0; |
| 166 | strListArgs = "hdm"; # Format "hiox:" = -h -i -o -x <arg> |
| 167 | listLongArgs = ["srcRoot=", "targetDir=", "cfgBldDir=", "prefix=", "cmakeBuildConfiguration=", |
| 168 | "argsFile", "buildConfig="]; |
| 169 | dictArgReq = { "-h": "o", # o = optional, m = mandatory |
| 170 | "-d": "o", |
| 171 | "-m": "o", |
| 172 | "--srcRoot": "m", |
| 173 | "--targetDir": "m", |
| 174 | "--cfgBldDir": "o", |
| 175 | "--buildConfig": "m", |
| 176 | "--prefix": "o", |
| 177 | "--cmakeBuildConfiguration": "o", |
| 178 | "--argsFile": "o" }; |
| 179 | |
| 180 | # Check for mandatory parameters |
| 181 | nResult, dictArgs, strMsg = utilsArgsParse.parse( vArgv, strListArgs, |
| 182 | listLongArgs, |
| 183 | dictArgReq, |
| 184 | strHelpInfo ); |
| 185 | if nResult < 0: |
| 186 | program_exit_on_failure( nResult, strMsg ); |
| 187 | |
| 188 | # User input -h for help |
| 189 | if nResult == 1: |
| 190 | program_exit_success( 0, strMsg ); |
| 191 | |
| 192 | return (nResult, dictArgs); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 193 | |
| 194 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 195 | # Details: Locate post process script language directory and the script within |
| 196 | # and execute. |
| 197 | # Args: vStrScriptLang - (R) Name of the script language to build. |
| 198 | # vstrFinishFileName - (R) Prefix file name to build full name. |
| 199 | # vDictArgs - (R) Program input parameters. |
| 200 | # Returns: Int - 0 = Success, < 0 some error condition. |
| 201 | # Str - Error message. |
| 202 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 203 | #-- |
| 204 | def run_post_process( vStrScriptLang, vstrFinishFileName, vDictArgs ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 205 | dbg = utilsDebug.CDebugFnVerbose( "run_post_process()" ); |
| 206 | nResult = 0; |
| 207 | strStatusMsg = ""; |
| 208 | strScriptFile = vstrFinishFileName % vStrScriptLang; |
| 209 | strScriptFileDir = "%s%s/%s" % (vDictArgs[ "--srcRoot" ], "/scripts", |
| 210 | vStrScriptLang); |
| 211 | strScriptFilePath = "%s/%s" % (strScriptFileDir, strScriptFile); |
| 212 | |
| 213 | # Check for the existence of the script file |
| 214 | strPath = os.path.normcase( strScriptFilePath ); |
| 215 | bOk = os.path.exists( strPath ); |
| 216 | if bOk == False: |
| 217 | strDir = os.path.normcase( strScriptFileDir ); |
| 218 | strStatusMsg = strScriptNotFound % (strScriptFile, strDir); |
| 219 | return (-9, strStatusMsg); |
| 220 | |
| 221 | if gbDbgFlag: |
| 222 | print strScriptLangFound % vStrScriptLang; |
| 223 | print strExecuteMsg % vStrScriptLang; |
| 224 | |
| 225 | # Change where Python looks for our modules |
| 226 | strDir = os.path.normcase( strScriptFileDir ); |
| 227 | sys.path.append( strDir ); |
| 228 | |
| 229 | # Execute the specific language script |
| 230 | dictArgs = vDictArgs; # Remove any args not required before passing on |
| 231 | strModuleName = strScriptFile[ : strScriptFile.__len__() - 3 ]; |
| 232 | module = __import__( strModuleName ); |
| 233 | nResult, strStatusMsg = module.main( dictArgs ); |
| 234 | |
| 235 | # Revert sys path |
| 236 | sys.path.remove( strDir ); |
| 237 | |
| 238 | return (nResult, strStatusMsg); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 239 | |
| 240 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 241 | # Details: Step through each script language sub directory supported |
| 242 | # and execute post processing script for each scripting language, |
| 243 | # make sure the build script for that language exists. |
| 244 | # For now the only language we support is Python, but we expect this |
| 245 | # to change. |
| 246 | # Args: vDictArgs - (R) Program input parameters. |
| 247 | # Returns: Int - 0 = Success, < 0 some error condition. |
| 248 | # Str - Error message. |
| 249 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 250 | #-- |
| 251 | def run_post_process_for_each_script_supported( vDictArgs ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 252 | dbg = utilsDebug.CDebugFnVerbose( "run_post_process_for_each_script_supported()" ); |
| 253 | nResult = 0; |
| 254 | strStatusMsg = ""; |
| 255 | strScriptDir = vDictArgs[ "--srcRoot" ] + "/scripts"; |
| 256 | strFinishFileName = "finishSwig%sLLDB.py"; |
| 257 | |
| 258 | # Check for the existence of the scripts folder |
| 259 | strScriptsDir = os.path.normcase( strScriptDir ); |
| 260 | bOk = os.path.exists( strScriptsDir ); |
| 261 | if bOk == False: |
| 262 | return (-8, strScriptDirNotFound); |
| 263 | |
| 264 | # Look for any script language directories to build for |
| 265 | listDirs = []; |
| 266 | nDepth = 1; |
| 267 | for strPath, listDirs, listFiles in os.walk( strScriptDir ): |
| 268 | nDepth = nDepth - 1; |
| 269 | if nDepth == 0: |
| 270 | break; |
| 271 | |
| 272 | if gbDbgFlag: |
| 273 | print strScriptLangsFound, |
| 274 | for dir in listDirs: |
| 275 | print dir, |
| 276 | print "\n"; |
| 277 | |
| 278 | # Iterate script directory find any script language directories |
| 279 | for scriptLang in listDirs: |
| 280 | dbg.dump_text( "Executing language script for \'%s\'" % scriptLang ); |
| 281 | nResult, strStatusMsg = run_post_process( scriptLang, strFinishFileName, |
| 282 | vDictArgs ); |
| 283 | if nResult < 0: |
| 284 | break; |
| 285 | |
| 286 | if nResult < 0: |
| 287 | strTmp = strPostProcessError % scriptLang; |
| 288 | strTmp += strStatusMsg; |
| 289 | strStatusMsg = strTmp; |
| 290 | |
| 291 | return (nResult, strStatusMsg); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 292 | |
| 293 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 294 | # Details: Program's main() with arguments passed in from the command line. |
| 295 | # Program either exits normally or with error from this function - |
| 296 | # top most level function. |
| 297 | # Args: vArgv - (R) List of arguments and values. |
| 298 | # Returns: None |
| 299 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 300 | #-- |
| 301 | def main( vArgv ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 302 | dbg = utilsDebug.CDebugFnVerbose( "main()" ); |
| 303 | bOk = False; |
| 304 | dictArgs = {}; |
| 305 | nResult = 0; |
| 306 | strMsg = ""; |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 307 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 308 | # The validate arguments fn will exit the program if tests fail |
| 309 | nResult, dictArgs = validate_arguments( vArgv ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 310 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 311 | eOSType = utilsOsType.determine_os_type(); |
| 312 | if eOSType == utilsOsType.EnumOsType.Unknown: |
| 313 | program_exit( -4, strMsgErrorOsTypeUnknown ); |
| 314 | |
| 315 | global gbDbgFlag; |
| 316 | gbDbgFlag = dictArgs.has_key( "-d" ); |
| 317 | if gbDbgFlag: |
| 318 | print_out_input_parameters( dictArgs ); |
| 319 | |
| 320 | # Check to see if we were called from the Makefile system. If we were, check |
| 321 | # if the caller wants SWIG to generate a dependency file. |
| 322 | # Not used in this program, but passed through to the language script file |
| 323 | # called by this program |
| 324 | global gbMakeFileFlag; |
| 325 | gbMakeFileFlag = dictArgs.has_key( "-m" ); |
| 326 | |
| 327 | nResult, strMsg = run_post_process_for_each_script_supported( dictArgs ); |
| 328 | |
| 329 | program_exit( nResult, strMsg ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 330 | |
| 331 | #----------------------------------------------------------------------------- |
| 332 | #----------------------------------------------------------------------------- |
| 333 | #----------------------------------------------------------------------------- |
| 334 | |
| 335 | #TAG_PROGRAM_HELP_INFO |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 336 | """ Details: Program main entry point. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 337 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 338 | -------------------------------------------------------------------------- |
| 339 | Args: -h (optional) Print help information on this program. |
| 340 | -d (optional) Determines whether or not this script |
| 341 | outputs additional information when running. |
| 342 | -m (optional) Specify called from Makefile system. If given locate |
| 343 | the LLDBWrapPython.cpp in --srcRoot/source folder |
| 344 | else in the --targetDir folder. |
| 345 | --srcRoot= The root of the lldb source tree. |
| 346 | --targetDir= Where the lldb framework/shared library gets put. |
| 347 | --cfgBldDir= Where the buildSwigPythonLLDB.py program will |
| 348 | (optional) put the lldb.py file it generated from running |
| 349 | SWIG. |
| 350 | --prefix= Is the root directory used to determine where |
| 351 | (optional) third-party modules for scripting languages should |
| 352 | be installed. Where non-Darwin systems want to put |
| 353 | the .py and .so files so that Python can find them |
| 354 | automatically. Python install directory. |
| 355 | --cmakeBuildConfiguration= (optional) Is the build configuration(Debug, Release, RelWithDebugInfo)\n\ |
| 356 | used to determine where the bin and lib directories are \n\ |
| 357 | created for a Windows build.\n\ |
| 358 | --argsFile= The args are read from a file instead of the |
| 359 | command line. Other command line args are ignored. |
| 360 | Usage: |
| 361 | finishSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath |
| 362 | --cfgBldDir=ADirPath --prefix=ADirPath -m -d |
| 363 | |
| 364 | Results: 0 Success |
| 365 | -1 Error - invalid parameters passed. |
| 366 | -2 Error - incorrect number of mandatory parameters passed. |
| 367 | |
| 368 | -4 Error - unable to determine OS type. |
| 369 | -5 Error - program not run with name of "__main__". |
| 370 | -8 Error - unable to locate the scripts folder. |
| 371 | -9 Error - unable to locate the post process language script |
| 372 | file. |
| 373 | |
| 374 | -100+ - Error messages from the child language script file. |
| 375 | |
| 376 | -------------------------------------------------------------------------- |
| 377 | |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 378 | """ |
| 379 | |
| 380 | # Called using "__main__" when not imported i.e. from the command line |
| 381 | if __name__ == "__main__": |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 382 | utilsDebug.CDebugFnVerbose.bVerboseOn = gbDbgVerbose; |
| 383 | dbg = utilsDebug.CDebugFnVerbose( "__main__" ); |
| 384 | main( sys.argv[ 1: ] ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 385 | else: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame^] | 386 | program_exit( -5, strMsgErrorNoMain ); |
| 387 | |