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

Python utils.main函数代码示例

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

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



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

示例1: main

def main():
  vt_mysqlbinlog =  os.environ.get('VT_MYSQL_ROOT') + '/bin/vt_mysqlbinlog'
  if not os.path.isfile(vt_mysqlbinlog):
    sys.exit("%s is not present, please install it and then re-run the test" % vt_mysqlbinlog)

  print "Note: This is a slow test, has a couple of sleeps in it to simulate proper state changes"

  utils.main()
开发者ID:CERN-Stage-3,项目名称:vitess,代码行数:8,代码来源:rowcache_invalidator.py


示例2: load

def load():
	import base
	base.main(dp)
	import text_parse
	text_parse.main(dp)
	import utils
	utils.main(dp)
	import vortaro
	vortaro.main(dp)
	import xkcd
	xkcd.main(dp)
开发者ID:nejni-marji,项目名称:NovaBot,代码行数:11,代码来源:main.py


示例3: main

def main(argv):
    load_all = True
    dump_all = True
    curr_frame = dict(start_day=1, start_hour=0,end_day=1,end_hour=1,year = 2009, month = 7)
    from config import update_time_frame
    try:
        opts, args = getopt.getopt(argv,"h",["sd=","sh=","ed=","eh="])
    except getopt.GetoptError:
        print 'driver-analysis --sd --sh --ed --eh '
        sys.exit(2)
    for opt, arg in opts:
        if opt == 'h':
            print 'driver-analysis --sd --sh --ed --eh '
            sys.exit()
        elif opt=="--sd":
            curr_frame["start_day"] = int(arg)
        elif opt=="--sh":
            curr_frame["start_hour"] = int(arg)
        elif opt=="--ed":
            curr_frame["end_day"] = int(arg)
        elif opt=="--eh":
            curr_frame["end_hour"] = int(arg)
    print curr_frame
#     time_frame_list = [dict(start_day=1, start_hour=0,end_day=1,end_hour=1,year = 2009, month = 7),
#                        dict(start_day=10, start_hour=0,end_day=11,end_hour=0,year = 2012, month = 4),
#                        dict(start_day=11, start_hour=0,end_day=12,end_hour=0,year = 2012, month = 4),
#                        dict(start_day=12, start_hour=0,end_day=13,end_hour=0,year = 2012, month = 4),
#                        dict(start_day=13, start_hour=0,end_day=14,end_hour=0,year = 2012, month = 4),
#                        dict(start_day=15, start_hour=0,end_day=16,end_hour=0,year = 2012, month = 4),
#                        ]
    update_time_frame(curr_frame)
    import utils
    utils.main()
    
    import grid
    grid.main(reload=load_all, dump=dump_all)
    
    import input_data
    # cProfile.run('input_data.main(reload_trip=load_all, reload_log=load_all, dump_trip=dump_all, dump_log=dump_all)')
    input_data.main(reload_trip=load_all, reload_log=load_all, dump_trip=dump_all, dump_log=dump_all)
     
    import driver_income
    driver_income.main(reload=load_all, dump=dump_all)
     
    import driver_state_stats
    driver_state_stats.main(reload=load_all, dump=dump_all)
     
    import relative_demand_grid
    relative_demand_grid.main(reload=load_all, dump= dump_all, dump_csv = dump_all)
     
    import zone_driver
    zone_driver.main(reload=load_all, dump= dump_all)
    print "job done!"
开发者ID:luning612,项目名称:driver-analysis,代码行数:53,代码来源:__main__.py


示例4: main

def main():
  parser = optparse.OptionParser(usage='usage: %prog [options] [test_names]')
  parser.add_option('-e', '--environment_type', help='Environment type',
                    default=None)
  parser.add_option('-n', '--name', help='Environment name', default=None)
  parser.add_option('-p', '--environment_params',
                    help='Environment parameters if creating an environment '
                    'for the test', default=None)
  parser.add_option('-t', '--test_params', help='Test parameters',
                    default=None)
  utils.add_options(parser)
  global _options
  _options, _ = parser.parse_args()
  del sys.argv[1:]

  utils.main()
开发者ID:32kb,项目名称:vitess,代码行数:16,代码来源:base_end2end_test.py


示例5: setUp

def setUp():
  """Sets up VtGate for integration tests in Java client"""

  create_table = '''create table vtgate_test (
  id bigint auto_increment,
  name varchar(64),
  age SMALLINT,
  percent DECIMAL(5,2),
  keyspace_id bigint(20) unsigned NOT NULL,
  primary key (id)
  ) Engine=InnoDB'''
  vtgatev2_test.create_tables.append(create_table)
  utils.main(vtgatev2_test)
  # this is read in Java test to set up connection params
  sys.stdout.write(json.dumps({
      "port": vtgatev2_test.vtgate_port,
      "keyspace_name": vtgatev2_test.KEYSPACE_NAME,
      "shard_kid_map": vtgatev2_test.shard_kid_map,
  }))
  sys.stdout.flush()
开发者ID:Mistobaan,项目名称:vitess,代码行数:20,代码来源:java_vtgate_test_helper.py


示例6: get

    def get(self, anno_id):
        # they can request a certain format by ending with .gobe whatever.
        self.response.headers['Content-type'] = 'text/plain';

        if anno_id == "":
            a = Annotation.all().order("-date").get()
        elif anno_id != "all":
            a = Annotation.all().filter('anno_id = ', anno_id).get()
        if a is None: a = Annotation()
        content = a.content

        if a.format and a.format != "gobe":
            content = [x.strip() for x in content.split("\n")]
            content = utils.main(content, a.format, force_tabs=True)

        self.response.out.write(content or "")
开发者ID:BioinformaticsArchive,项目名称:gobe,代码行数:16,代码来源:main.py


示例7: Diagnostico

def Diagnostico():
    funciones.LimpiaDirectorio(ruta)
    utils.main()
    ProcesosComunes()
开发者ID:procamora,项目名称:Testeador-de-Red,代码行数:4,代码来源:main.py


示例8: Completo

def Completo():
    funciones.LimpiaDirectorio(ruta)
    speedtest.main()
    utils.main()
    ProcesosComunes()
开发者ID:procamora,项目名称:Testeador-de-Red,代码行数:5,代码来源:main.py


示例9:

#!/usr/bin/env python

# Copyright 2017 Google Inc.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


"""Re-runs backup.py with use_mysqlctld=True."""

import backup
import utils

if __name__ == '__main__':
  backup.use_mysqlctld = True
  utils.main(backup)
开发者ID:alainjobart,项目名称:vitess,代码行数:25,代码来源:backup_mysqlctld.py


示例10: remove_possession

            self.game_data[item.name] = item

    def remove_possession(self, name):
        item = self.game_data[name]
        item.count -= 1
        if not item.count:
            del self.game_data[name]
            self.possessions.remove(item)

    def make_opt_epilog(self):
        return ""

    def add_quiz_answer(self, q, a):
        self.game_data[q] = a
        self.quiz_answers.append([q, a])

    def first_situation(self):
        return OpeningCredits(self)

    def _jump_to_situation(self):
        if self.jump_to.endswith(".csv"):
            self.jump_to = "MainSituation_%s" % self.jump_to.split(".csv")[0]

        sit = globals()[self.jump_to](self)
        utils._log("JUMPING TO SITUATION: %s (%s)" % (self.jump_to, sit.__class__.__name__))
        return sit


if __name__ == "__main__":
    utils.main(InTheEndGame)
开发者ID:mcanultyfamily,项目名称:InTheEnd,代码行数:30,代码来源:InTheEnd.py


示例11:

#!/usr/bin/env python
#
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.

"""Re-runs merge_sharding.py with a varbinary keyspace_id."""

from vtdb import keyrange_constants

import base_sharding
import merge_sharding
import utils


if __name__ == '__main__':
  base_sharding.keyspace_id_type = keyrange_constants.KIT_BYTES
  utils.main(merge_sharding)
开发者ID:CowLeo,项目名称:vitess,代码行数:18,代码来源:merge_sharding_bytes.py


示例12: add_test_options

      except urllib2.HTTPError as e:
        self.assertEqual(e.code, 307)
      # Verify that the command logged something and its available at /status.
      status = urllib2.urlopen(worker_base_url + '/status').read()
      self.assertIn(
          "Ping command was called with message: 'pong'", status,
          'Command did not log output to /status')

      # Reset the job.
      urllib2.urlopen(worker_base_url + '/reset').read()
      status_after_reset = urllib2.urlopen(worker_base_url + '/status').read()
      self.assertIn(
          'This worker is idle.', status_after_reset,
          '/status does not indicate that the reset was successful')


def add_test_options(parser):
  parser.add_option(
      '--num_insert_rows', type='int', default=100,
      help='The number of rows, per shard, that we should insert before '
      'resharding for this test.')
  parser.add_option(
      '--num_insert_rows_before_reparent_test', type='int', default=3000,
      help='The number of rows, per shard, that we should insert before '
      'running TestReparentDuringWorkerCopy (supersedes --num_insert_rows in '
      'that test). There must be enough rows such that SplitClone takes '
      'several seconds to run while we run a planned reparent.')

if __name__ == '__main__':
  utils.main(test_options=add_test_options)
开发者ID:DalianDragon,项目名称:vitess,代码行数:30,代码来源:worker.py


示例13:

#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Re-runs vtgatev2_test.py with a l2vtgate process."""

import utils
import vtgatev2_test

# This test is just re-running an entire vtgatev2_test.py with a
# l2vtgate process in the middle.
if __name__ == '__main__':
  vtgatev2_test.use_l2vtgate = True
  utils.main(vtgatev2_test)
开发者ID:alainjobart,项目名称:vitess,代码行数:26,代码来源:vtgatev2_l2vtgate_test.py


示例14: main

def main():
  print "Note: This is a slow test, has a couple of sleeps in it to simulate proper state changes"
  utils.main()
开发者ID:ballacky13,项目名称:vitess,代码行数:3,代码来源:rowcache_invalidator.py


示例15:

#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Re-runs update_stream.py with RBR."""

import update_stream
import utils

if __name__ == '__main__':
  update_stream.use_rbr = True
  utils.main(update_stream)
开发者ID:alainjobart,项目名称:vitess,代码行数:24,代码来源:update_stream_rbr.py


示例16:

#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Re-runs resharding.py with RBR on."""

import base_sharding
import vertical_split
import utils

if __name__ == '__main__':
  base_sharding.use_rbr = True
  utils.main(vertical_split)
开发者ID:alainjobart,项目名称:vitess,代码行数:25,代码来源:vertical_split_rbr.py


示例17:

#!/usr/bin/env python
#
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.

import initial_sharding
import utils

from vtdb import keyrange_constants

# this test is just re-running an entire initial_sharding.py with a
# varbinary keyspace_id
if __name__ == '__main__':
  initial_sharding.keyspace_id_type = keyrange_constants.KIT_BYTES
  utils.main(initial_sharding)
开发者ID:Carney,项目名称:vitess,代码行数:16,代码来源:initial_sharding_bytes.py


示例18: main

def main():
    utils.main(InTheEnd.InTheEndGame)    
开发者ID:mcanultyfamily,项目名称:InTheEnd,代码行数:2,代码来源:main.py


示例19:

        #
        # We must run an explicit healthcheck or we can see one of the two states:
        # - NOT_SERVING, DisableQueryService=false, tablet type 'spare'
        #   (immediately after SplitDiff returned)
        # - SERVING, DisableQueryService=false, tablet type 'rdonly'
        #   (during healthcheck before post-action callback is called)
        utils.run_vtctl(["RunHealthCheck", worker.shard_rdonly1.tablet_alias], auto_log=True)

        # source shard: query service must be disabled after MigrateServedTypes.
        utils.check_tablet_query_service(self, worker.shard_rdonly1, serving=False, tablet_control_disabled=True)
        utils.check_tablet_query_service(self, worker.shard_replica, serving=False, tablet_control_disabled=True)
        utils.check_tablet_query_service(self, worker.shard_master, serving=False, tablet_control_disabled=True)

        # dest shard -80: query service must be disabled after MigrateServedTypes.
        # Run explicit healthcheck because 'rdonly' tablet may still be 'spare'.
        utils.run_vtctl(["RunHealthCheck", worker.shard_0_rdonly1.tablet_alias], auto_log=True)
        utils.check_tablet_query_service(self, worker.shard_0_rdonly1, serving=True, tablet_control_disabled=False)
        utils.check_tablet_query_service(self, worker.shard_0_replica, serving=True, tablet_control_disabled=False)
        utils.check_tablet_query_service(self, worker.shard_0_master, serving=True, tablet_control_disabled=False)

        # dest shard 80-: query service must be disabled after MigrateServedTypes.
        # Run explicit healthcheck because 'rdonly' tablet is still 'spare'.
        utils.run_vtctl(["RunHealthCheck", worker.shard_1_rdonly1.tablet_alias], auto_log=True)
        utils.check_tablet_query_service(self, worker.shard_1_rdonly1, serving=True, tablet_control_disabled=False)
        utils.check_tablet_query_service(self, worker.shard_1_replica, serving=True, tablet_control_disabled=False)
        utils.check_tablet_query_service(self, worker.shard_1_master, serving=True, tablet_control_disabled=False)


if __name__ == "__main__":
    utils.main(test_options=worker.add_test_options)
开发者ID:Analyticalloopholes,项目名称:vitess,代码行数:30,代码来源:automation_horizontal_resharding.py


示例20:

#!/usr/bin/env python
#
# Copyright 2014, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.

import utils
import resharding

from vtdb import keyrange_constants

# this test is the same as resharding_bytes.py, but it uses vtworker to
# do the clone.
if __name__ == '__main__':
  resharding.keyspace_id_type = keyrange_constants.KIT_BYTES
  resharding.use_clone_worker = True
  utils.main(resharding)
开发者ID:Carney,项目名称:vitess,代码行数:17,代码来源:resharding_bytes_vtworker.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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