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

Python setup_util.replace_text函数代码示例

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

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



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

示例1: start

def start(args):
    setup_util.replace_text(
        "php-symfony2/app/config/parameters.yml", "database_host: .*", "database_host: " + args.database_host
    )
    setup_util.replace_text(
        "php-symfony2/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks"
    )

    try:
        subprocess.check_call("composer.phar install", shell=True, cwd="php-symfony2")
        subprocess.check_call("php app/console cache:clear --env=prod --no-debug", shell=True, cwd="php-symfony2")
        subprocess.check_call("sudo chown -R www-data:www-data php-symfony2", shell=True)
        subprocess.check_call(
            "sudo php-fpm --fpm-config config/php-fpm.conf -g "
            + home
            + "/FrameworkBenchmarks/php-symfony2/deploy/php-fpm.pid",
            shell=True,
        )
        subprocess.check_call(
            "sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-symfony2/deploy/nginx.conf",
            shell=True,
        )
        return 0
    except subprocess.CalledProcessError:
        return 1
开发者ID:GMADIGITAL,项目名称:FrameworkBenchmarks,代码行数:25,代码来源:setup.py


示例2: start

def start(args, logfile, errfile):
    setup_util.replace_text("hhvm/once.php.inc", "host=localhost;", "host=" + args.database_host + ";")
    setup_util.replace_text(
        "hhvm/deploy/config.hdf",
        "SourceRoot = .*\/FrameworkBenchmarks",
        "SourceRoot = " + home + "/FrameworkBenchmarks",
    )
    setup_util.replace_text(
        "hhvm/deploy/config.hdf", "Path = .*\/.hhvm.hhbc", "Path = " + home + "/FrameworkBenchmarks/hhvm/.hhvm.bbhc"
    )
    setup_util.replace_text(
        "hhvm/deploy/config.hdf", "PidFile = .*\/hhvm.pid", "PidFile = " + home + "/FrameworkBenchmarks/hhvm/hhvm.pid"
    )
    setup_util.replace_text(
        "hhvm/deploy/config.hdf", "File = .*\/error.log", "File = " + home + "/FrameworkBenchmarks/hhvm/error.log"
    )

    try:
        if os.name == "nt":
            # Not supported !
            return 0
        subprocess.check_call(
            "hhvm --config " + home + "/FrameworkBenchmarks/hhvm/deploy/config.hdf -m daemon",
            shell=True,
            stderr=errfile,
            stdout=logfile,
        )
        return 0
    except subprocess.CalledProcessError:
        return 1
开发者ID:kazeburo,项目名称:FrameworkBenchmarks,代码行数:30,代码来源:setup.py


示例3: start

def start(args, logfile, errfile, cwd="wt"):
    setup_util.replace_text("wt/benchmark.cpp", "INSERT_DB_HOST_HERE", args.database_host)
    subprocess.check_call(
        "g++ -O3 -DNDEBUG -std=c++0x -L/usr/local/lib -I/usr/local/include -o benchmark.wt benchmark.cpp -lwt -lwthttp -lwtdbo -lwtdbomysql -lboost_thread",
        shell=True,
        cwd=cwd,
        stderr=errfile,
        stdout=logfile,
    )
    os.environ["LD_LIBRARY_PATH"] = "/usr/local/lib:" + os.environ.get("LD_LIBRARY_PATH", ".")
    subprocess.Popen(
        [
            "./benchmark.wt",
            "-c",
            "wt_config.xml",
            "-t",
            str(args.max_threads * 4),
            "--docroot",
            ".",
            "--http-address",
            "0.0.0.0",
            "--http-port",
            "8080",
            "--accesslog=-",
            "--no-compression",
        ],
        cwd=cwd,
        stderr=errfile,
        stdout=logfile,
    )
    return 0
开发者ID:seem-sky,项目名称:FrameworkBenchmarks,代码行数:31,代码来源:setup.py


示例4: start

def start(args):
    setup_util.replace_text(cwd + "/server.py", "localhost", args.database_host)

    subprocess.Popen(
        "python %s/FrameworkBenchmarks/tornado/server.py --port=8080 --logging=error" % home, shell=True, cwd=cwd
    )
    return 0
开发者ID:thangnvaltplus,项目名称:FrameworkBenchmarks,代码行数:7,代码来源:setup.py


示例5: start

def start(args, logfile, errfile):
  setup_util.replace_text("vertx/app.js", "host: '.*'", "host: '" + args.database_host + "'")
  try:
    subprocess.Popen("vertx run app.js", shell=True, cwd="vertx", stderr=errfile, stdout=logfile)
    return 0
  except subprocess.CalledProcessError:
    return 1
开发者ID:AbhijitDutta,项目名称:FrameworkBenchmarks,代码行数:7,代码来源:setup.py


示例6: start

def start(args, logfile, errfile):
  setup_util.replace_text("lapis/config.lua", "DBHOSTNAME", args.database_host)
  setup_util.replace_text("lapis/nginx.conf", "DBHOSTNAME", args.database_host)
  #subprocess.Popen('/usr/local/openresty/nginx/sbin/nginx -c `pwd`/nginx.conf -g "worker_processes ' + str((args.max_threads)) + ';"', shell=True, cwd="lapis", stderr=errfile, stdout=logfile)
  subprocess.Popen('lapis server production', shell=True, cwd="lapis", stderr=errfile, stdout=logfile)

  return 0
开发者ID:BenBBear,项目名称:FrameworkBenchmarks,代码行数:7,代码来源:setup.py


示例7: start

def start(args, logfile, errfile):
  setup_util.replace_text("onion/hello.c", "mysql_real_connect\(data.db\[i\], \".*\",", "mysql_real_connect(data.db[i], \"" + args.database_host + "\",")
  os.putenv("ONION_LOG","noinfo")
  subprocess.call("rm *.o", cwd="onion", shell=True, stderr=errfile, stdout=logfile)
  subprocess.call("cp -R installs/onion/* onion/onion", shell=True, stderr=errfile, stdout=logfile)
  subprocess.Popen("make && ./hello", shell=True, cwd="onion", stderr=errfile, stdout=logfile)
  return 0
开发者ID:DavidS,项目名称:FrameworkBenchmarks,代码行数:7,代码来源:setup.py


示例8: start

def start(args):
  setup_util.replace_text("lift-stateless/src/main/scala/Main.scala", "> \".*:3306", "> \"" + args.database_host + ":3306")

  subprocess.check_call("../sbt/sbt update assembly", shell=True, cwd="lift-stateless")
  subprocess.Popen("./run", shell=True, cwd="lift-stateless")

  return 0
开发者ID:smw1218,项目名称:FrameworkBenchmarks,代码行数:7,代码来源:setup.py


示例9: start

def start(args):
  setup_util.replace_text("ringojs/ringo-main.js", "dbHost = '.*';", "dbHost = '" + args.database_host + "';")

  try:
    subprocess.Popen("ringo --production ringo-main.js", shell=True, cwd="ringojs")
    return 0
  except subprocess.CalledProcessError:
    return 1
开发者ID:1100110,项目名称:FrameworkBenchmarks,代码行数:8,代码来源:setup.py


示例10: start

def start(args):
  setup_util.replace_text("vertx/App.groovy", "host: '.*'", "host: '" + args.database_host + "'")

  try:    
    subprocess.Popen("vertx run WebServer.java", shell=True, cwd="vertx")
    return 0
  except subprocess.CalledProcessError:
    return 1
开发者ID:Web5design,项目名称:FrameworkBenchmarks,代码行数:8,代码来源:setup.py


示例11: start

def start(args):
  setup_util.replace_text("snap/bench/cfg/db.cfg", "host=\".*\"", "host=\"" + args.database_host + "\"")
  subprocess.check_call("cabal configure", shell=True, cwd="snap/bench")
  subprocess.check_call("cabal build", shell=True, cwd="snap/bench")

  t = str(args.max_threads)
  subprocess.Popen("dist/build/snap-bench/snap-bench +RTS -A" + t + "M -N" + t + " > /dev/null", shell=True, cwd="snap/bench")
  return 0
开发者ID:RaphaelJ,项目名称:FrameworkBenchmarks,代码行数:8,代码来源:setup.py


示例12: start

def start(args):
  setup_util.replace_text("snap/bench/cfg/db.cfg", "host=\".*\"", "host=\"" + args.database_host + "\"")
  subprocess.check_call("cabal install HDBC HDBC-mysql MonadCatchIO-transformers configurator json snap-core snap-server resource-pool", shell=True)  
  subprocess.check_call("cabal configure", shell=True, cwd="snap/bench")
  subprocess.check_call("cabal install", shell=True, cwd="snap/bench")

  subprocess.Popen("dist/build/snap-bench/snap-bench +RTS -N" + str(args.max_threads) + " > /dev/null", shell=True, cwd="snap/bench")
  return 0
开发者ID:Tener,项目名称:FrameworkBenchmarks,代码行数:8,代码来源:setup.py


示例13: start

def start(args):
    setup_util.replace_text(
        cwd + "/server.py", "localhost", args.database_host)

    subprocess.Popen(
        python + " server.py --port=8080 --logging=error",
        shell=True, cwd=cwd)
    return 0
开发者ID:Kepinator,项目名称:FrameworkBenchmarks,代码行数:8,代码来源:setup.py


示例14: start

def start(args, logfile, errfile):
  setup_util.replace_text("unfiltered/src/main/resources/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
  setup_util.replace_text("unfiltered/src/main/resources/application.conf", "maxThreads = \\d+", "maxThreads = " + str(args.max_threads))

  subprocess.check_call("../sbt/sbt assembly", shell=True, cwd="unfiltered", stderr=errfile, stdout=logfile)
  subprocess.Popen("java -jar bench-assembly-1.0.0.jar", shell=True, cwd="unfiltered/target/scala-2.10", stderr=errfile, stdout=logfile)

  return 0
开发者ID:AbhijitDutta,项目名称:FrameworkBenchmarks,代码行数:8,代码来源:setup_unfiltered.py


示例15: start

def start(args, logfile, errfile):
  setup_util.replace_text("onion/hello.c", "mysql_real_connect\(data.db\[i\], \".*\",", "mysql_real_connect(data.db[i], \"" + args.database_host + "\",")
  
  subprocess.call("rm -f *.o", cwd="onion", shell=True, stderr=errfile, stdout=logfile)
  subprocess.call("cp -R $IROOT/onion/ onion/onion", shell=True, stderr=errfile, stdout=logfile)
  subprocess.call("rm CMakeCache.txt", shell=True, cwd="onion/onion/build", stderr=errfile, stdout=logfile)
  subprocess.Popen("make && ./hello", shell=True, cwd="onion", stderr=errfile, stdout=logfile)
  return 0
开发者ID:BenBBear,项目名称:FrameworkBenchmarks,代码行数:8,代码来源:setup.py


示例16: start

def start(args):
  setup_util.replace_text("snap/bench/cfg/db.cfg", "host=\".*\"", "host=\"" + args.database_host + "\"")
  subprocess.check_call("cabal update", shell=True, cwd="snap/bench")
  subprocess.check_call("cabal install --only-dependencies", shell=True, cwd="snap/bench")
  subprocess.check_call("cabal build", shell=True, cwd="snap/bench")

  subprocess.Popen("dist/build/snap-bench/snap-bench +RTS -A4M -N -qg2 -I0 -G2 > /dev/null", shell=True, cwd="snap/bench")
  return 0
开发者ID:jason-dean,项目名称:FrameworkBenchmarks,代码行数:8,代码来源:setup.py


示例17: start

def start(args):
  setup_util.replace_text("vertx/App.groovy", "host: '.*'", "host: '" + args.database_host + "'")

  try:
    subprocess.check_call("javac WebServer.java -cp $VERTX_HOME/lib/vertx-core-1.3.1.final.jar:$VERTX_HOME/lib/vertx-platform-1.3.1.final.jar:$VERTX_HOME/lib/mustache.jar:$VERTX_HOME/lib/jackson-core-asl-1.9.4.jar:$VERTX_HOME/lib/jackson-mapper-asl-1.9.4.jar:$VERTX_HOME/lib/guava-11.0.2.jar", shell=True, cwd="vertx")
    subprocess.Popen("vertx run App.groovy", shell=True, cwd="vertx")
    return 0
  except subprocess.CalledProcessError:
    return 1
开发者ID:Falmarri,项目名称:FrameworkBenchmarks,代码行数:9,代码来源:setup.py


示例18: start

def start(args):
  setup_util.replace_text("play204-scala/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")

  subprocess.check_call("play dist", shell=True, cwd="play204-scala")
  subprocess.check_call("unzip play204-scala-1.0-SNAPSHOT.zip", shell=True, cwd="play204-scala/dist")
  subprocess.check_call("chmod +x start", shell=True, cwd="play204-scala/dist/play204-scala-1.0-SNAPSHOT")
  subprocess.Popen("./start", shell=True, cwd="play204-scala/dist/play204-scala-1.0-SNAPSHOT")

  return 0
开发者ID:wsargent,项目名称:FrameworkBenchmarks,代码行数:9,代码来源:setup.py


示例19: start

def start(args, logfile, errfile):
  setup_util.replace_text("snap/bench/cfg/db.cfg", "host=\".*\"", "host=\"" + args.database_host + "\"")
  subprocess.check_call("cabal update", shell=True, cwd="snap/bench", stderr=errfile, stdout=logfile)
  subprocess.check_call("cabal install", shell=True, cwd="snap/bench", stderr=errfile, stdout=logfile)
  subprocess.check_call("cabal configure", shell=True, cwd="snap/bench", stderr=errfile, stdout=logfile)
  subprocess.check_call("cabal build", shell=True, cwd="snap/bench", stderr=errfile, stdout=logfile)

  subprocess.Popen("dist/build/snap-bench/snap-bench +RTS -A4M -N -qg2 -I0 -G2", shell=True, cwd="snap/bench", stderr=errfile, stdout=logfile)
  return 0
开发者ID:AbhijitDutta,项目名称:FrameworkBenchmarks,代码行数:9,代码来源:setup.py


示例20: start

def start(args):
  setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'")
  setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu",  home)
  # because pooling doesn't work with meinheld, it's necessary to create a ton of gunicorn threads (think apache pre-fork)
  # to allow the OS to switch processes when waiting for socket I/O.
  #args.max_threads *= 8
  # and go from there until the database server runs out of memory for new threads (connections)
  subprocess.Popen("gunicorn hello.wsgi:application --worker-class=\"egg:meinheld#gunicorn_worker\"  -b 0.0.0.0:8080 -w " + str((args.max_threads * 8)) + " --log-level=critical", shell=True, cwd="django/hello")
  return 0
开发者ID:LekisS,项目名称:FrameworkBenchmarks,代码行数:9,代码来源:setup.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python setup_utils.getInput函数代码示例发布时间:2022-05-27
下一篇:
Python utils.get_company_currency函数代码示例发布时间: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