本文整理汇总了Python中utilsOsType.determine_os_type函数的典型用法代码示例。如果您正苦于以下问题:Python determine_os_type函数的具体用法?Python determine_os_type怎么用?Python determine_os_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了determine_os_type函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_symlink_native
def make_symlink_native(vDictArgs, strSrc, strTarget):
eOSType = utilsOsType.determine_os_type()
bDbg = "-d" in vDictArgs
bOk = True
strErrMsg = ""
target_filename = os.path.basename(strTarget)
if eOSType == utilsOsType.EnumOsType.Unknown:
bOk = False
strErrMsg = strErrMsgOsTypeUnknown
elif eOSType == utilsOsType.EnumOsType.Windows:
if bDbg:
print((strMsgSymlinkMk % (target_filename, strSrc, strTarget)))
bOk, strErrMsg = make_symlink_windows(strSrc,
strTarget)
else:
if os.path.islink(strTarget):
if bDbg:
print((strMsgSymlinkExists % target_filename))
return (bOk, strErrMsg)
if bDbg:
print((strMsgSymlinkMk % (target_filename, strSrc, strTarget)))
bOk, strErrMsg = make_symlink_other_platforms(strSrc,
strTarget)
return (bOk, strErrMsg)
示例2: make_symlink
def make_symlink(
vDictArgs,
vstrFrameworkPythonDir,
vstrSrcFile,
vstrTargetFile):
dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink()")
bOk = True
strErrMsg = ""
bDbg = "-d" in vDictArgs
strTarget = os.path.join(vstrFrameworkPythonDir, vstrTargetFile)
strTarget = os.path.normcase(strTarget)
strSrc = ""
os.chdir(vstrFrameworkPythonDir)
bMakeFileCalled = "-m" in vDictArgs
eOSType = utilsOsType.determine_os_type()
if not bMakeFileCalled:
strBuildDir = os.path.join("..", "..", "..")
else:
# Resolve vstrSrcFile path relatively the build directory
if eOSType == utilsOsType.EnumOsType.Windows:
# On a Windows platform the vstrFrameworkPythonDir looks like:
# llvm\\build\\Lib\\site-packages\\lldb
strBuildDir = os.path.join("..", "..", "..")
else:
# On a UNIX style platform the vstrFrameworkPythonDir looks like:
# llvm/build/lib/python2.7/site-packages/lldb
strBuildDir = os.path.join("..", "..", "..", "..")
strSrc = os.path.normcase(os.path.join(strBuildDir, vstrSrcFile))
return make_symlink_native(vDictArgs, strSrc, strTarget)
示例3: main
def main(vArgv):
dbg = utilsDebug.CDebugFnVerbose("main()")
bOk = False
dictArgs = {}
nResult = 0
strMsg = ""
# The validate arguments fn will exit the program if tests fail
nResult, dictArgs = validate_arguments(vArgv)
eOSType = utilsOsType.determine_os_type()
if eOSType == utilsOsType.EnumOsType.Unknown:
program_exit(-4, strMsgErrorOsTypeUnknown)
global gbDbgFlag
gbDbgFlag = "-d" in dictArgs
if gbDbgFlag:
print_out_input_parameters(dictArgs)
# Check to see if we were called from the Makefile system. If we were, check
# if the caller wants SWIG to generate a dependency file.
# Not used in this program, but passed through to the language script file
# called by this program
global gbMakeFileFlag
global gbSwigGenDepFileFlag
gbMakeFileFlag = "-m" in dictArgs
gbSwigGenDepFileFlag = "-M" in dictArgs
bOk, strMsg = check_lldb_swig_file_exists(dictArgs["--srcRoot"], eOSType)
if bOk == False:
program_exit(-3, strMsg)
nResult, strMsg = run_swig_for_each_script_supported(dictArgs)
program_exit(nResult, strMsg)
示例4: create_symlinks
def create_symlinks(vDictArgs, vstrFrameworkPythonDir, vstrLldbLibDir):
dbg = utilsDebug.CDebugFnVerbose("Python script create_symlinks()")
bOk = True
strErrMsg = ""
eOSType = utilsOsType.determine_os_type()
# Make symlink for _lldb
strLibLldbFileName = "_lldb"
if bOk:
bOk, strErrMsg = make_symlink_liblldb(vDictArgs,
vstrFrameworkPythonDir,
strLibLldbFileName,
vstrLldbLibDir)
# Make symlink for darwin-debug on Darwin
strDarwinDebugFileName = "darwin-debug"
if bOk and eOSType == utilsOsType.EnumOsType.Darwin:
bOk, strErrMsg = make_symlink_darwin_debug(vDictArgs,
vstrFrameworkPythonDir,
strDarwinDebugFileName)
# Make symlink for lldb-argdumper
strArgdumperFileName = "lldb-argdumper"
if bOk:
bOk, strErrMsg = make_symlink_lldb_argdumper(vDictArgs,
vstrFrameworkPythonDir,
strArgdumperFileName)
return (bOk, strErrMsg)
示例5: make_symlink_liblldb
def make_symlink_liblldb(vDictArgs, vstrFrameworkPythonDir, vstrLiblldbFileName):
dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_liblldb()")
bOk = True
strErrMsg = ""
strTarget = vstrLiblldbFileName
strSrc = ""
eOSType = utilsOsType.determine_os_type()
if eOSType == utilsOsType.EnumOsType.Windows:
# When importing an extension module using a debug version of python, you
# write, for example, "import foo", but the interpreter searches for
# "foo_d.pyd"
if is_debug_interpreter():
strTarget += "_d"
strTarget += ".pyd"
else:
strTarget += ".so"
bMakeFileCalled = "-m" in vDictArgs
if not bMakeFileCalled:
strSrc = os.path.join("lib", "LLDB")
else:
strLibFileExtn = ""
if eOSType == utilsOsType.EnumOsType.Windows:
strSrc = os.path.join("bin", "liblldb.dll")
else:
if eOSType == utilsOsType.EnumOsType.Darwin:
strLibFileExtn = ".dylib"
else:
strLibFileExtn = ".so"
strSrc = os.path.join("lib", "liblldb" + strLibFileExtn)
bOk, strErrMsg = make_symlink(vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
return (bOk, strErrMsg)
示例6: make_symlink_liblldb
def make_symlink_liblldb( vDictArgs, vstrFrameworkPythonDir, vstrLiblldbFileName ):
dbg = utilsDebug.CDebugFnVerbose( "Python script make_symlink_liblldb()" );
bOk = True;
strErrMsg = "";
strTarget = vstrLiblldbFileName;
strSrc = "";
eOSType = utilsOsType.determine_os_type();
if eOSType == utilsOsType.EnumOsType.Windows:
# When importing an extension module using a debug version of python, you
# write, for example, "import foo", but the interpreter searches for
# "foo_d.pyd"
if vDictArgs["--buildConfig"].lower() == "debug":
strTarget += "_d";
strTarget += ".pyd";
else:
strTarget += ".so";
bMakeFileCalled = vDictArgs.has_key( "-m" );
if not bMakeFileCalled:
strSrc = os.path.join("lib", "LLDB");
else:
strLibFileExtn = "";
if eOSType == utilsOsType.EnumOsType.Windows:
strSrc = os.path.join("bin", "liblldb.dll");
else:
if eOSType == utilsOsType.EnumOsType.Darwin:
strLibFileExtn = ".dylib";
else:
strLibFileExtn = ".so";
strSrc = os.path.join("lib", "liblldb" + strLibFileExtn);
bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget );
return (bOk, strErrMsg);
示例7: make_symlink_lldb_argdumper
def make_symlink_lldb_argdumper(
vDictArgs,
vstrFrameworkPythonDir,
vstrArgdumperFileName):
dbg = utilsDebug.CDebugFnVerbose(
"Python script make_symlink_lldb_argdumper()")
bOk = True
strErrMsg = ""
strTarget = vstrArgdumperFileName
strSrc = ""
eOSType = utilsOsType.determine_os_type()
if eOSType == utilsOsType.EnumOsType.Windows:
strTarget += ".exe"
bMakeFileCalled = "-m" in vDictArgs
if not bMakeFileCalled:
return (bOk, strErrMsg)
else:
strExeFileExtn = ""
if eOSType == utilsOsType.EnumOsType.Windows:
strExeFileExtn = ".exe"
strSrc = os.path.join("bin", "lldb-argdumper" + strExeFileExtn)
bOk, strErrMsg = make_symlink(
vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
return (bOk, strErrMsg)
示例8: main
def main( vArgv ):
dbg = utilsDebug.CDebugFnVerbose( "main()" );
bOk = False;
dictArgs = {};
nResult = 0;
strMsg = "";
# The validate arguments fn will exit the program if tests fail
nResult, dictArgs = validate_arguments( vArgv );
eOSType = utilsOsType.determine_os_type();
if eOSType == utilsOsType.EnumOsType.Unknown:
program_exit( -4, strMsgErrorOsTypeUnknown );
global gbDbgFlag;
gbDbgFlag = dictArgs.has_key( "-d" );
if gbDbgFlag:
print_out_input_parameters( dictArgs );
# Check to see if we were called from the Makefile system. If we were, check
# if the caller wants SWIG to generate a dependency file.
# Not used in this program, but passed through to the language script file
# called by this program
global gbMakeFileFlag;
gbMakeFileFlag = dictArgs.has_key( "-m" );
nResult, strMsg = run_post_process_for_each_script_supported( dictArgs );
program_exit( nResult, strMsg );
示例9: get_help_information
def get_help_information():
strHelpMsg = strHelpInfo;
eOSType = utilsOsType.determine_os_type();
if eOSType == utilsOsType.EnumOsType.Windows:
strHelpMsg += strHelpInfoExtraWindows;
else:
strHelpMsg += strHelpInfoExtraNonWindows;
return strHelpMsg;
示例10: make_symlink
def make_symlink( vDictArgs, vstrFrameworkPythonDir, vstrSrcFile, vstrTargetFile ):
dbg = utilsDebug.CDebugFnVerbose( "Python script make_symlink()" );
bOk = True;
strErrMsg = "";
bDbg = vDictArgs.has_key( "-d" );
strTarget = os.path.join(vstrFrameworkPythonDir, vstrTargetFile);
strTarget = os.path.normcase( strTarget );
strSrc = "";
os.chdir( vstrFrameworkPythonDir );
bMakeFileCalled = vDictArgs.has_key( "-m" );
eOSType = utilsOsType.determine_os_type();
if not bMakeFileCalled:
return (bOk, strErrMsg);
else:
# Resolve vstrSrcFile path relatively the build directory
if eOSType == utilsOsType.EnumOsType.Windows:
# On a Windows platform the vstrFrameworkPythonDir looks like:
# llvm\\build\\Lib\\site-packages\\lldb
strBuildDir = os.path.join("..", "..", "..");
else:
# On a UNIX style platform the vstrFrameworkPythonDir looks like:
# llvm/build/lib/python2.7/site-packages/lldb
strBuildDir = os.path.join("..", "..", "..", "..");
strSrc = os.path.normcase(os.path.join(strBuildDir, vstrSrcFile));
strTargetDir = os.path.dirname(strTarget);
strSrc = os.path.relpath(os.path.abspath(strSrc), strTargetDir);
if eOSType == utilsOsType.EnumOsType.Unknown:
bOk = False;
strErrMsg = strErrMsgOsTypeUnknown;
elif eOSType == utilsOsType.EnumOsType.Windows:
if os.path.isfile( strTarget ):
if bDbg:
print strMsgSymlinkExists % vstrTargetFile;
return (bOk, strErrMsg);
if bDbg:
print strMsgSymlinkMk % (vstrTargetFile, strSrc, strTarget);
bOk, strErrMsg = make_symlink_windows( strSrc,
strTarget );
else:
if os.path.islink( strTarget ):
if bDbg:
print strMsgSymlinkExists % vstrTargetFile;
return (bOk, strErrMsg);
if bDbg:
print strMsgSymlinkMk % (vstrTargetFile, strSrc, strTarget);
bOk, strErrMsg = make_symlink_other_platforms( strSrc,
strTarget );
return (bOk, strErrMsg);
示例11: make_symlink
def make_symlink(vDictArgs, vstrFrameworkPythonDir):
dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink()")
bOk = True
strWkDir = ""
strErrMsg = ""
strSoFileName = "_lldb"
eOSType = utilsOsType.determine_os_type()
if eOSType == utilsOsType.EnumOsType.Unknown:
bOk = False
strErrMsg = strErrMsgOsTypeUnknown
elif eOSType == utilsOsType.EnumOsType.Windows:
bOk, strErrMsg = make_symlink_windows(vDictArgs, vstrFrameworkPythonDir, strSoFileName)
else:
bOk, strErrMsg = make_symlink_other_platforms(vDictArgs, vstrFrameworkPythonDir, strSoFileName)
return (bOk, strErrMsg)
示例12: get_framework_python_dir
def get_framework_python_dir( vDictArgs ):
dbg = utilsDebug.CDebugFnVerbose( "Python script get_framework_python_dir()" );
bOk = True;
strWkDir = "";
strErrMsg = "";
eOSType = utilsOsType.determine_os_type();
if eOSType == utilsOsType.EnumOsType.Unknown:
bOk = False;
strErrMsg = strErrMsgOsTypeUnknown;
elif eOSType == utilsOsType.EnumOsType.Windows:
bOk, strWkDir, strErrMsg = get_framework_python_dir_windows( vDictArgs );
else:
bOk, strWkDir, strErrMsg = get_framework_python_dir_other_platforms( vDictArgs );
return (bOk, strWkDir, strErrMsg);
示例13: make_symlink_liblldb
def make_symlink_liblldb( vDictArgs, vstrFrameworkPythonDir, vstrLiblldbFileName ):
dbg = utilsDebug.CDebugFnVerbose( "Python script make_symlink_liblldb()" );
bOk = True;
strErrMsg = "";
strTarget = vstrLiblldbFileName;
strSrc = "";
eOSType = utilsOsType.determine_os_type();
if eOSType == utilsOsType.EnumOsType.Windows:
# When importing an extension module using a debug version of python, you
# write, for example, "import foo", but the interpreter searches for
# "foo_d.pyd"
if is_debug_interpreter():
strTarget += "_d";
strTarget += ".pyd";
else:
strTarget += ".so";
bMakeFileCalled = vDictArgs.has_key( "-m" );
if not bMakeFileCalled:
strSrc = os.path.join("lib", "LLDB");
else:
strLibFileExtn = "";
if eOSType == utilsOsType.EnumOsType.Windows:
strSrc = os.path.join("bin", "liblldb.dll");
else:
if eOSType == utilsOsType.EnumOsType.Darwin:
strLibFileExtn = ".dylib";
else:
strLibFileExtn = ".so";
strSrc = os.path.join("lib", "liblldb" + strLibFileExtn);
if eOSType != utilsOsType.EnumOsType.Windows:
# Create a symlink to the "lib" directory, to ensure liblldb's RPATH is
# effective.
bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, "lib", os.path.join("../lib") );
if not bOk:
return (bOk, strErrMsg)
bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget );
return (bOk, strErrMsg);
示例14: make_symlink_other_platforms
def make_symlink_other_platforms(vDictArgs, vstrFrameworkPythonDir, vstrSoPath):
dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink_other_platforms()")
bOk = True
strMsg = ""
bDbg = vDictArgs.has_key("-d")
strTarget = vstrSoPath + ".so"
strSoPath = "%s/%s" % (vstrFrameworkPythonDir, strTarget)
strTarget = os.path.normcase(strSoPath)
strSrc = ""
os.chdir(vstrFrameworkPythonDir)
bMakeFileCalled = vDictArgs.has_key("-m")
if not bMakeFileCalled:
strSrc = os.path.normcase("../../../LLDB")
else:
strLibFileExtn = ""
eOSType = utilsOsType.determine_os_type()
if eOSType == utilsOsType.EnumOsType.Linux:
strLibFileExtn = ".so"
elif eOSType == utilsOsType.EnumOsType.Darwin:
strLibFileExtn = ".dylib"
strSrc = os.path.normcase("../../../liblldb%s" % strLibFileExtn)
if os.path.islink(strTarget):
if bDbg:
print strMsglldbsoExists % strTarget
return (bOk, strMsg)
if bDbg:
print strMsglldbsoMk
try:
os.symlink(strSrc, strTarget)
except OSError as e:
bOk = False
strMsg = "OSError( %d ): %s %s" % (e.errno, e.strerror, strErrMsgMakeSymlink)
strMsg += " Src:'%s' Target:'%s'" % (strSrc, strTarget)
except:
bOk = False
strMsg = strErrMsgUnexpected % sys.exec_info()[0]
return (bOk, strMsg)
示例15: make_symlink_argdumper
def make_symlink_argdumper( vDictArgs, vstrFrameworkPythonDir, vstrArgdumperFileName ):
dbg = utilsDebug.CDebugFnVerbose( "Python script make_symlink_argdumper()" );
bOk = True;
strErrMsg = "";
strTarget = vstrArgdumperFileName;
strSrc = "";
eOSType = utilsOsType.determine_os_type();
if eOSType == utilsOsType.EnumOsType.Windows:
strTarget += ".exe";
bMakeFileCalled = vDictArgs.has_key( "-m" );
if not bMakeFileCalled:
return (bOk, strErrMsg);
else:
strExeFileExtn = "";
if eOSType == utilsOsType.EnumOsType.Windows:
strExeFileExtn = ".exe";
strSrc = os.path.join("bin", "argdumper" + strExeFileExtn);
bOk, strErrMsg = make_symlink( vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget );
return (bOk, strErrMsg);