コード例 #1
0
ファイル: commands.py プロジェクト: wuqunfei/scrapy-tegenaria
def test():
    """Run the tests and check spider contracts."""
    from pytest import main
    rv = main([TEST_PATH, '--verbose'])
    if rv:
        exit(rv)

    # Run scrapy check with a return code, in the foreground.
    scrapy = local['scrapy']
    rv = scrapy['check', '-v'] & RETCODE(FG=True)
    exit(rv)
コード例 #2
0
    def main(self):
        args = sys.argv[1:]
        cmd_name = args[0]
        cmd_param = args[1:]

        to_file = '{}/avdrunner.log'.format(
            AVD_LOGPATH) if AVD_LOGPATH else None

        lpl.init_logger('AVDRunner', to_stream=False, to_file=to_file)

        cmd = local[cmd_name]
        lpl.info('Running {} with params {}'.format(cmd_name, cmd_param))
        exit_code = cmd[cmd_param] & RETCODE(FG=True)
        lpl.info('{} completed. exit_code: {}'.format(cmd_name, exit_code))
        if exit_code != 0:
            lpl.error('Command {} with params {} FAILED'.format(
                cmd_name, cmd_param))
コード例 #3
0
ファイル: main.py プロジェクト: manastech/plaster
    def run_zests(self, **kwargs):
        coverage = kwargs.pop("coverage", False)
        important(f"Running zests{' (with coverage)' if coverage else ''}...")
        if coverage:
            raise NotImplementedError
            ret = local["coverage"]["run", "./gen_main.py",
                                    "zest"] & RETCODE(FG=True)
            if ret == 0:
                local["coverage"]["html"] & FG
                local["xdg-open"]("./.coverage_html/index.html")
        else:
            from zest.zest_runner import ZestRunner

            try:
                runner = ZestRunner(include_dirs="./gen:./run:./tools",
                                    **kwargs)
                if runner.retcode != 0:
                    raise CommandError
                return 0
            except Exception as e:
                colorful_exception(e)
                return 1
コード例 #4
0
 def main(self):
     return supervisord[
         '-n', '-c',
         '/etc/supervisor/zmqrpc.supervisord.conf'] & RETCODE(FG=True)
コード例 #5
0
 def main(self):
     return supervisord[
         '-n', '-c',
         '/etc/supervisor/celery-worker.supervisord.conf'] & RETCODE(
             FG=True)
コード例 #6
0
 def main(self):
     return supervisord['-n'] & RETCODE(FG=True)
コード例 #7
0
 def main(self):
     return uwsgi['--reload', '/tmp/uwsgi.pid'] & RETCODE(FG=True)