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