• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python sh.make函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sh.make函数的典型用法代码示例。如果您正苦于以下问题:Python make函数的具体用法?Python make怎么用?Python make使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: compile

 def compile( self, source_dir, build_dir, install_dir ):
     package_source_dir = os.path.join( source_dir, self.dirname )
     assert( os.path.exists( package_source_dir ) )
     package_build_dir = os.path.join( build_dir, self.dirname )
     runpath_dir = os.path.join( package_source_dir, 'RunPath' )
     if ( not os.path.exists( os.path.join( runpath_dir, 'media.zip' ) ) ):
         sh.cd( runpath_dir )
         sh.wget( '--no-check-certificate', 'https://bitbucket.org/jacmoe/ogitor/downloads/media.zip' )
         sh.unzip( 'media.zip' )
     if ( not os.path.exists( os.path.join( runpath_dir, 'projects.zip' ) ) ):
         sh.cd( runpath_dir )
         sh.wget( '--no-check-certificate', 'https://bitbucket.org/jacmoe/ogitor/downloads/projects.zip' )
         sh.unzip( 'projects.zip' )
     sh.mkdir( '-p', package_build_dir )
     sh.cd( package_build_dir )
     if ( platform.system() == 'Darwin' ):
         sh.cmake(
             '-G', 'Xcode',
             '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir,
             '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join( install_dir, 'CMake' ),
             package_source_dir,
             _out = sys.stdout )
         sh.xcodebuild( '-configuration', 'Release', _out = sys.stdout )
     else:
         sh.cmake(
             '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir,
             '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join( install_dir, 'lib/OGRE/cmake' ),
             package_source_dir,
             _out = sys.stdout )
         sh.make( '-j4', 'VERBOSE=1', _out = sys.stdout )
         sh.make.install( _out = sys.stdout )
开发者ID:TTimo,项目名称:es_build,代码行数:31,代码来源:20_ogitor.py


示例2: build_opencv

def build_opencv():
    sh.pip.install("numpy")
    clone_if_not_exists("opencv", "https://github.com/PolarNick239/opencv.git", branch="stable_3.0.0)
    clone_if_not_exists("opencv_contrib", "https://github.com/PolarNick239/opencv_contrib.git", branch="stable_3.0.0")
    sh.rm("-rf", "build")
    sh.mkdir("build")
    sh.cd("build")
    python_path = pathlib.Path(sh.pyenv.which("python").stdout.decode()).parent.parent
    version = "{}.{}".format(sys.version_info.major, sys.version_info.minor)
    sh.cmake(
        "..",
        "-DCMAKE_BUILD_TYPE=RELEASE",
        "-DCMAKE_INSTALL_PREFIX={}/usr/local".format(python_path),
        "-DWITH_CUDA=OFF",
        "-DWITH_FFMPEG=OFF",
        "-DINSTALL_C_EXAMPLES=OFF",
        "-DBUILD_opencv_legacy=OFF",
        "-DBUILD_NEW_PYTHON_SUPPORT=ON",
        "-DBUILD_opencv_python3=ON",
        "-DOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.1/modules",
        "-DBUILD_EXAMPLES=ON",
        "-DPYTHON_EXECUTABLE={}/bin/python".format(python_path),
        "-DPYTHON3_LIBRARY={}/lib/libpython{}m.so".format(python_path, version),
        "-DPYTHON3_PACKAGES_PATH={}/lib/python{}/site-packages/".format(python_path, version),
        "-DPYTHON3_NUMPY_INCLUDE_DIRS={}/lib/python{}/site-packages/numpy/core/include".format(python_path, version),
        "-DPYTHON_INCLUDE_DIR={}/include/python{}m".format(python_path, version),
        _out=sys.stdout,
    )
    sh.make("-j4", _out=sys.stdout)
    sh.make.install(_out=sys.stdout)
开发者ID:hephaex,项目名称:toolchain,代码行数:30,代码来源:build_opencv.py


示例3: build_latex_pdf

def build_latex_pdf(output_filename="cscutcher_cv_latex.pdf"):
    """Build latex style pdf."""
    resume = nx6_cv.resume.get_resume()

    output_stream = Path(output_filename).open('wb')

    with tempfile.TemporaryDirectory(prefix="nx6_cv_latex_") as tmpdir:
        tmpdir = Path(tmpdir)

        # Copy latex sources
        for path in pkg_resources.resource_listdir(__name__, "latex"):
            (tmpdir / path).open('wb').write(
                pkg_resources.resource_string(
                    __name__, os.path.join("latex", path)))

        template_raw = (tmpdir / 'cv.tex.mako').open().read()

        # Stop mako nuking '//' in tex
        template_raw = re.sub(
            r"\\$",
            r"\\\\" + "\n",
            template_raw,
            flags=re.MULTILINE)

        # Render and write template
        template = mako.template.Template(template_raw)
        tex = template.render_unicode(cv=resume)
        (tmpdir / 'cv.tex').open('w').write(tex)

        # Add gitrevision tex
        (tmpdir / 'gitrevision.tex').open('w').write("NOTSET")

        sh.make("-C", str(tmpdir.resolve()))
        output_stream.write((tmpdir / 'cv.pdf').open('rb').read())
开发者ID:cscutcher,项目名称:cv,代码行数:34,代码来源:cli.py


示例4: compile

    def compile( self, source_dir, build_dir, install_dir ):
        package_source_dir = os.path.join( source_dir, self.dirname )
        assert( os.path.exists( package_source_dir ) )
        package_build_dir = os.path.join( build_dir, self.dirname )

        sh.cd( os.path.join( package_source_dir, 'scripts/Resources' ) )
        sh.sh( './copyresources.sh' )
        # the install target doesn't copy the stuff that copyresources.sh puts in place
        sh.cp( '-v', os.path.join( package_source_dir, 'bin/Release/Readme.txt' ), os.path.join( install_dir, 'Readme.meshy.txt' ) )
        sh.cp( '-v', '-r', os.path.join( package_source_dir, 'bin/Release_Linux/Resources/' ), install_dir )

        sh.mkdir( '-p', package_build_dir )
        sh.cd( package_build_dir )
        if ( platform.system() == 'Darwin' ):
            sh.cmake(
                '-G', 'Xcode',
                '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir,
                '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join( install_dir, 'CMake' ),
                package_source_dir,
                _out = sys.stdout )
            sh.xcodebuild( '-configuration', 'Release', _out = sys.stdout )
        else:
            sh.cmake(
                '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir,
                '-D', 'CMAKE_MODULE_PATH=%s' % os.path.join( install_dir, 'lib/OGRE/cmake' ),
                package_source_dir,
                _out = sys.stdout )
            sh.make( '-j4', 'VERBOSE=1', _out = sys.stdout )
            sh.make.install( _out = sys.stdout )
开发者ID:TTimo,项目名称:es_build,代码行数:29,代码来源:20_ogremeshy.py


示例5: generate_template

def generate_template():
    template_file = ""
    if not isdir(build_dir):
        mkdir(build_dir)
    if isdir(build_dir):
        template_file = build_dir + "/dekko.dekkoproject.pot"
        print("TemplateFile: " + template_file)
        cd(build_dir)
        print("Running cmake to generate updated template")
        cmake('..')
        print("Running make")
        make("-j2")
    if isfile(template_file):
        if isdir(po_dir):
            print("Moving template to po dir: " + po_dir)
            mv(template_file, po_dir)
        else:
            print("Couldn't find po dir: " + po_dir)
            cleanup()
            return
    else:
        cleanup()
        print("No template found for: " + template_file)
        return
    print("Cleaning up")
    cleanup()
    print("YeeHaa!")
    print("All done, you need to commit & push this to bitbucket now :-)")
    print("NOTE: this would also be a good time to sync with launchpad, run")
    print("  $ python3 launchpad_sync.py")
开发者ID:ubuntu-touch-apps,项目名称:dekko,代码行数:30,代码来源:update_translations.py


示例6: main

def main():
    filename = 'my_config'
    include_path = 'inc'
    test_path = '/home/leha/personal/configen/configen/test/data'
    test_files = glob(os.path.join(test_path, '*.json'))
    #test_files = [os.path.join(test_path, 'test_schema.json')]
    # copy header with helper test functions
    sh.cp(os.path.join(test_path, 'serialization_tests.h'), '.')
    # iterate over all files in test directory
    for test_filename in test_files:
        test_name = os.path.basename(test_filename).split('.')[0]
        print('Test file: ' + test_name)
        string_of_json = open(test_filename, 'r').read()
        code = cg.convert_json(string_of_json, language='c++',
                               namespace=['config'], filename=filename,
                               include_path=include_path);
        # write header, source and main
        with open(os.path.join(include_path, filename + '.h'), 'w') as header:
            header.write(code['header'])
        with open(os.path.join(filename + '.cc'), 'w') as src:
            src.write(code['source'])
        main_filename = os.path.join(test_path, test_name + '.cc')
        if os.path.exists(main_filename):
            sh.cp(main_filename, 'main.cc')
        else:
            print('Default main')
            with open('main.cc', 'w') as main_:
                main_.write('\n'.join(DEFAULT_MAIN))
        sh.make()
        # check c code
        run_main = sh.Command('./configen_test')
        check_output(run_main())
开发者ID:alexey-naydenov,项目名称:configen,代码行数:32,代码来源:hand_test.py


示例7: main

def main():
    sh.mkdir("-p","log")
    sh.fuser("-k","-n","tcp","4040", _ok_code=[0,1])

    printc("COMPILE FRONTEND", color="blue")
    with chdir("frontend"):
        sh.make("compile", _out="../log/compile.txt")

    printc("UNIT TESTS", color="blue")
    fail = False
    try:
        with chdir("frontend"):
            sh.npm.test(_out="../log/unit_tests.txt")
        printc("PASS UNIT TESTS", color="green")
    except:
        with open("log/unit_tests.txt","r") as fd:
            print(fd.read())
        printc("FAIL UNIT TESTS", color="red")
        fail = True

    if fail:
        printc("FAIL", color="red")
        sys.exit(1)
    else:
        printc("SUCCESS", color="green")
    sys.exit(0)
开发者ID:serverboards,项目名称:serverboards,代码行数:26,代码来源:frontend-test.py


示例8: recompile

def recompile(pset):
    """Overwrite params.h and recompiles the speedbenchmark code"""
    with open("../src/params.h", "w") as f:
        f.write(str(pset))
    sh.cd("speedbenchmark")
    sh.make("clean")
    sh.make()
    sh.cd("../")
开发者ID:klausie,项目名称:markovian,代码行数:8,代码来源:learn.py


示例9: install_cmake

def install_cmake( build_dir, prefix ):
    cmake_archive='cmake-2.8.11.2'
    sh.cd( build_dir )
    sh.wget( '-nc', 'http://www.cmake.org/files/v2.8/%s.tar.gz' % cmake_archive )
    sh.tar( 'xvzf', '%s.tar.gz' % cmake_archive )
    sh.cd( cmake_archive )
    subprocess.check_call( [ './configure', '--prefix', PREFIX ], shell = True )
    sh.make( '-j4' )
    sh.make.install()
开发者ID:unhit,项目名称:es_build,代码行数:9,代码来源:stage3-src.py


示例10: upgrade_git

def upgrade_git( build_dir, prefix ):
    sh.cd( build_dir )
    if ( os.path.exists( 'git' ) ):
        sh.cd( 'git' )
        sh.git.pull()
    else:
        sh.git.clone( 'https://github.com/git/git' )
        sh.cd( 'git' )
    sh.make( 'prefix=%s' % prefix, '-j4' )
    sh.make.install( 'prefix=%s' % prefix )
开发者ID:unhit,项目名称:es_build,代码行数:10,代码来源:stage3-src.py


示例11: launch

 def launch(self, worker):
     # `vagrant up` is slow even when VM is already running so bypass that with a
     # grep of the process name
     if not subprocess.call(
         "ps aux | grep '[V]BoxHeadless --comment stencila-worker'",
         shell=True,
         stdout=open(os.devnull, 'w')
     ) == 0:
         sh.make('worker-launch-vagrant')
     worker.ip = "10.0.1.100"
     worker.platform_id = "vbox-on-localhost"
开发者ID:stencila,项目名称:hub,代码行数:11,代码来源:virtualbox.py


示例12: compile

    def compile( self, source_dir, build_dir, install_dir ):
        package_source_dir = os.path.join( source_dir, self.dirname )
        assert( os.path.exists( package_source_dir ) )
        package_build_dir = os.path.join( build_dir, self.dirname )
        sh.mkdir( '-p', package_build_dir )

        sh.cd( package_source_dir )
        subprocess.check_call( [ os.path.join( package_source_dir, 'autogen.sh') ] )

        sh.cd( package_build_dir )
        subprocess.check_call( [ os.path.join( package_source_dir, 'configure' ), '--prefix=%s' % install_dir, '--with-libzmq=%s' % install_dir ] )
        sh.make( '-j4', _out = sys.stdout )
        sh.make.install( _out = sys.stdout )
开发者ID:TTimo,项目名称:es_build,代码行数:13,代码来源:20_czmq.py


示例13: compile

 def compile( self, source_dir, build_dir, install_dir ):
     package_source_dir = os.path.join( source_dir, self.dirname )
     assert( os.path.exists( package_source_dir ) )
     package_build_dir = os.path.join( build_dir, self.dirname )
     sh.mkdir( '-p', package_build_dir )
     sh.cd( package_build_dir )
     if ( platform.system() == 'Darwin' ):
         sh.cmake( '-G', 'Xcode', '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, package_source_dir, _out = sys.stdout )            
         sh.xcodebuild( '-scheme', 'install', '-configuration', 'Release', _out = sys.stdout )
     else:
         sh.cmake( '-D', 'CMAKE_INSTALL_PREFIX=%s' % install_dir, package_source_dir, _out = sys.stdout )
         sh.make( '-j4', 'VERBOSE=1', _out = sys.stdout )
         sh.make.install( _out = sys.stdout )
开发者ID:TTimo,项目名称:es_build,代码行数:13,代码来源:10_ogre.py


示例14: compile

    def compile( self, source_dir, build_dir, install_dir ):
        package_source_dir = os.path.join( source_dir, self.dirname )
        assert( os.path.exists( package_source_dir ) )
        package_build_dir = os.path.join( build_dir, self.dirname )
        sh.mkdir( '-p', package_build_dir )

        # Invoke autogen.sh if configure script doesn't exist
        if not os.path.exists( '%s%s%s' % ( package_source_dir, os.sep, 'configure' ) ):
            sh.cd( package_source_dir )
            subprocess.check_call( [ os.path.join( package_source_dir, 'autogen.sh') ], shell = True )

        sh.cd( package_build_dir )
        subprocess.check_call( [ os.path.join( package_source_dir, 'configure' ), '--prefix=%s' % install_dir, '--with-libzmq=%s' % install_dir ], shell = True )
        sh.make( '-j4', _out = sys.stdout )
        sh.make.install( _out = sys.stdout )
开发者ID:unhit,项目名称:es_build,代码行数:15,代码来源:20_czmq.py


示例15: loop

 def loop(self):
     while True:
         # time.sleep(20)
         print "Pulling..."
         git.pull()
         latest_commit = self.__latest_commit()
         if self.__current_commit == latest_commit:
             # Sleep sometime, or next loop
             continue
         self.__current_commit = latest_commit
         try:
             make('test')
         except sh.ErrorReturnCode:
             print "Error"
             continue
开发者ID:WhiteIsClosing,项目名称:plib,代码行数:15,代码来源:ci.py


示例16: grade

def grade(uniqname, link):
    print("Grading {}".format(uniqname))
    with pushd("373-f15-linked-list"):
        wget(link, "-O", "{}.c".format(uniqname))
        rm("-f", "list.c", "list.o", "list")
        ln("-s", "{}.c".format(uniqname), "list.c")
        make("run")
        try:
            diff("list.out", "golden.out")
            perfect_grade(uniqname)
        except sh.ErrorReturnCode_1:
            try:
                diff("list.out", "naive.out")
                no_change(uniqname)
            except sh.ErrorReturnCode_1:
                handgrade(uniqname)
开发者ID:ppannuto,项目名称:373-f15-linked-list,代码行数:16,代码来源:grade.py


示例17: compile

    def compile( self, source_dir, build_dir, install_dir ):
        package_source_dir = os.path.join( source_dir, self.dirname )
        assert( os.path.exists( package_source_dir ) )
        package_build_dir = os.path.join( build_dir, self.dirname )
        sh.mkdir( '-p', package_build_dir )

        # Always invoke autogen - there is one checked in but it doesn't work on my local setup for instance
        sh.cd( package_source_dir )
        subprocess.check_call( [ os.path.join( package_source_dir, 'autogen.sh' ) ] ),

        # NOTE: there are problems with cmake support on this still, so using the autotools stuff
        sh.cd( package_build_dir )
        # http://bugs.python.org/issue6689
        subprocess.check_call( [ os.path.join( package_source_dir, 'configure' ), '--prefix=%s' % install_dir ] )
        sh.make( '-j4', _out = sys.stdout )
        sh.make.install( _out = sys.stdout )
开发者ID:TTimo,项目名称:es_build,代码行数:16,代码来源:10_libzmq.py


示例18: test_search

    def test_search(self):
        """Make sure aspiration search is the same as ordinary search
        Uses random fens as values, so not guaranteed to produce the same
        output when run multiple times"""
        lines = str(sh.rl("test/data/fenio.fens", "--count=10")).rstrip("\n")

        sh.make("aspire_search")
        run = sh.Command("./aspire_search")
        aspire_output = str(run(sh.echo(lines)))

        sh.make("no_aspire_search")
        run = sh.Command("./no_aspire_search")
        no_aspire_output = str(run(sh.echo(lines)))

        for fen_orig, fen1, fen2 in zip(lines.split("\n"), aspire_output.split("\n"), no_aspire_output.split("\n")):
            self.assertEquals(fen1, fen2, "Original fen: '%s'" % fen_orig)
开发者ID:naftaliharris,项目名称:markovian,代码行数:16,代码来源:runtests.py


示例19: build_client

def build_client():
        sh.make('distclean', _ok_code=(0, 1, 2))
        repo_dir = _repo_path('xivo-client-qt')
        print('running qmake...')
        # sh.Command('qmake')('QMAKE_CXX=colorgcc', _cwd=repo_dir)
        sh.Command('qmake')(_cwd=repo_dir)
        print('running make...')
        for line in sh.make('-s',
                            '-j4',
                            'FUNCTESTS=yes',
                            'DEBUG=yes',
                            _cwd=repo_dir,
                            _iter=True):
            if "ERROR" in line:
                logger.error("Compile error : {0}".format(line))
            print line
开发者ID:jpgelinas,项目名称:xivodev,代码行数:16,代码来源:xivodev.py


示例20: setup

def setup(flamegraph_directory, flamegraph_path, perf_map_agent_path, java_home):
    """Setup deps for flamegraph"""

    # Create the flamegraph directory and clean the directory
    if not os.path.exists(flamegraph_directory):
        os.mkdir(flamegraph_directory)
    for f in os.listdir(flamegraph_directory):
        file_path = os.path.join(flamegraph_directory, f)
        sh.sudo.rm(file_path)

    if not os.path.exists(perf_map_agent_path):
        sh.git('clone', 'https://github.com/jrudolph/perf-map-agent', perf_map_agent_path)
        sh.cmake('.', _cwd=perf_map_agent_path, _env={'JAVA_HOME': java_home})
        sh.make(_cwd=perf_map_agent_path)

    if not os.path.exists(flamegraph_path):
        sh.git('clone', 'https://github.com/brendangregg/FlameGraph', flamegraph_path)
开发者ID:TheRealFalcon,项目名称:cstar_perf,代码行数:17,代码来源:flamegraph.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python sh.mkdir函数代码示例发布时间:2022-05-27
下一篇:
Python sh.ls函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap