当前位置: 首页>>代码示例>>Python>>正文


Python Utils.isMac方法代码示例

本文整理汇总了Python中utils.Utils.isMac方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.isMac方法的具体用法?Python Utils.isMac怎么用?Python Utils.isMac使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utils.Utils的用法示例。


在下文中一共展示了Utils.isMac方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: genHellos

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import isMac [as 别名]
def genHellos(outFilename, overWrite = False, python = False):
    if python:
        if not outFilename.endswith(".py"):
            outFilename = outFilename + ".py"
        if os.path.exists(outFilename) and not overWrite:
            raise Exception(CT.boldRed("File ") + CT.boldBlack(outFilename) + CT.boldRed(" already exists, use --overWrite to over write it"))
        genPyHello(outFilename)
        #rwx to user and group, r-x to everyone
        fd = os.open( outFilename, os.O_RDONLY )
        os.fchmod( fd, 0o775)
        os.close( fd )
        print((CT.boldGreen("Now run")))
        print(("./" + outFilename + " "))
        print((CT.boldGreen("or")))
        print(("./" + outFilename + " --name Nick"))
    else:
        if not outFilename.endswith(".cpp"):
            outFilename = outFilename + ".cpp"
        if os.path.exists(outFilename) and not overWrite:
            raise Exception("File " + outFilename + " already exists, use --overWrite to over write it")
        genCppHello(outFilename)
        print((CT.boldGreen("Now run")))
        print(("g++ -std=c++11 " + outFilename + " -o hello #-std=c++11 needed for cstdint include in libstdc++"))
        print ("./hello")
        print((CT.boldGreen("or run")))
        #mac
        if Utils.isMac():
            print(("clang++ " + outFilename + " -o hello"))
        else:
            print(("clang++-3.6 -std=c++11 " + outFilename + " -o hello #-std=c++11 needed for cstdint include in libstdc++"))
        print ("./hello")
开发者ID:bailey-lab,项目名称:SeekDeep,代码行数:33,代码来源:genHelloWorld.py

示例2: main

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import isMac [as 别名]
def main():
    args = parse_args()
    s = Setup(args)
    ccWhich = Utils.which(s.CC)
    cxxWhich = Utils.which(s.CXX)
    cmakeWhich = Utils.which("cmake")
    if not ccWhich or not cxxWhich or not cmakeWhich:
        if not ccWhich:
            print CT.boldRed("Could not find c compiler " + CT.purple + s.CC)
            if args.compfile:
                print "Change CC in " + args.compfile
            else:
                print "Can supply another c compiler by using -CC [option] or by defining bash environmental CC "
            print ""
        if not cxxWhich:
            print CT.boldRed("Could not find c++ compiler " + CT.purple + s.CXX)
            if args.compfile:
                print "Change CXX in " + args.compfile
            else:
                print "Can supply another c++ compiler by using -CXX [option] or by defining bash environmental CXX "
            print ""
        if not cmakeWhich:
            print CT.boldRed("Could not find " + CT.purple + "cmake")
            if Utils.isMac():
                print "If you have brew install via, brew update && brew install cmake, otherwise you can follow instructions from http://www.cmake.org/install/"
            else:
                print "On ubuntu to install latest cmake do the following"
                print "sudo add-apt-repository ppa:george-edison55/cmake-3.x"
                print "sudo apt-get update"
                print "sudo apt-get install cmake"
        return 1
        
    
    if(args.instRPackageName):
        s.installRPackageName(args.instRPackageName[0])
        return 0
    if(args.instRPackageSource):
        s.installRPackageSource(args.instRPackageSource[0])
        return 0
    if args.updateBibProjects:
        projectsSplit = args.updateBibProjects.split(",")
        s.updateBibProjects(projectsSplit)
        return 0
    if args.printLibs:
        s.printAvailableSetUps()
    elif args.addBashCompletion:
        if(os.path.isdir("./bashCompletes")):
            cmd = "cat bashCompletes/* >> ~/.bash_completion"
            Utils.run(cmd)
        if(os.path.isdir("./bash_completion.d")):
            cmd = "cat bash_completion.d/* >> ~/.bash_completion"
            Utils.run(cmd)
    else:
        if len(s.setUpsNeeded) == 0:
            s.printAvailableSetUps()
            return 1
        else:
            s.setup()
            return 0
开发者ID:nickjhathaway,项目名称:njhRInside,代码行数:61,代码来源:setup.py

示例3: main

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import isMac [as 别名]
def main():
    name = "njhcpp"
    libs = "boost_filesystem:1_68_0,pstreams:RELEASE_1_0_1,jsoncpp:1.8.3,cppitertools:v0.2.1,zlib:1.2.11"
    args = genHelper.parseNjhConfigureArgs()
    if Utils.isMac():
        cmd = genHelper.mkConfigCmd(name, libs, sys.argv, "-lpthread,-lz")
    else:
        cmd = genHelper.mkConfigCmd(name, libs, sys.argv, "-lpthread,-lz,-lrt")
    Utils.run(cmd)
开发者ID:umass-bib,项目名称:bibcpp,代码行数:11,代码来源:configure.py

示例4: determineCXX

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import isMac [as 别名]
 def determineCXX(args, defaultCXX="clang++-3.8"):
     if Utils.isMac():
         defaultCXX = "clang++"
     if not args.CXX:
         eCXX = os.getenv("CXX")
         if eCXX:
             defaultCXX = eCXX
     else:
         defaultCXX = Utils.getStrFromStrOrList(args.CXX)
     return defaultCXX
开发者ID:nickjhathaway,项目名称:gtkmmExperiment,代码行数:12,代码来源:genFuncs.py

示例5: determineCC

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import isMac [as 别名]
 def determineCC(args, defaultCC="clang-3.8"):
     if Utils.isMac():
         defaultCC = "clang"
     if not args.CC:
         eCC = os.getenv("CC")
         if eCC:
             defaultCC = eCC
     else:
         defaultCC = Utils.getStrFromStrOrList(args.CC)
     return defaultCC
开发者ID:nickjhathaway,项目名称:gtkmmExperiment,代码行数:12,代码来源:genFuncs.py

示例6: determineCXX

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import isMac [as 别名]
 def determineCXX(args):
     defaultCXX = "clang++-3.5"
     if Utils.isMac():
         defaultCXX = "clang++"
     if not args.CXX:
         eCXX = os.getenv("CXX")
         if  eCXX:
             defaultCXX = eCXX
     else:
         defaultCXX = args.CXX[0]
     return defaultCXX
开发者ID:nickjhathaway,项目名称:njhRInside,代码行数:13,代码来源:genFuncs.py

示例7: determineCC

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import isMac [as 别名]
 def determineCC(args):
     defaultCC = "clang-3.5"
     if Utils.isMac():
         defaultCC = "clang"
     if not args.CC:
         eCC = os.getenv("CC")
         if(eCC):
             defaultCC =  eCC
     else:
         defaultCC = args.CC[0]
     return defaultCC
开发者ID:nickjhathaway,项目名称:njhRInside,代码行数:13,代码来源:genFuncs.py

示例8: main

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import isMac [as 别名]
def main():
    name = "njhseq"
    #libs = "bamtools:develop,bibcpp:develop,armadillo:8.200.0"
    libs = "TwoBit:v2.0.9,bamtools:v2.5.2"
    args = genHelper.parseNjhConfigureArgs()
    if Utils.isMac():
        macv, _, _ = platform.mac_ver()
        macv = float('.'.join(macv.split('.')[:2]))
        if macv < 10.12:
            if args.CC and "gcc" in args.CC[0]:
                pass
            else:
                libs = libs + ",sharedMutex:develop"
    cmd = genHelper.mkConfigCmd(name, libs, sys.argv)
    Utils.run(cmd)
开发者ID:bailey-lab,项目名称:bibseq,代码行数:17,代码来源:configure.py

示例9: isMac

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import isMac [as 别名]
def isMac():
    return Utils.isMac()
开发者ID:nickjhathaway,项目名称:njhRInside,代码行数:4,代码来源:setup.py


注:本文中的utils.Utils.isMac方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。