本文整理汇总了Python中libgiza.app.BuildApp.pool_size方法的典型用法代码示例。如果您正苦于以下问题:Python BuildApp.pool_size方法的具体用法?Python BuildApp.pool_size怎么用?Python BuildApp.pool_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libgiza.app.BuildApp
的用法示例。
在下文中一共展示了BuildApp.pool_size方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mine
# 需要导入模块: from libgiza.app import BuildApp [as 别名]
# 或者: from libgiza.app.BuildApp import pool_size [as 别名]
def mine(args):
conf = fetch_config(args)
app = BuildApp(conf)
app.pool_size = 4
gh = get_connection(conf)
pprint(mine_github_pulls(gh, app, conf))
示例2: test_add_existing_app_object
# 需要导入模块: from libgiza.app import BuildApp [as 别名]
# 或者: from libgiza.app.BuildApp import pool_size [as 别名]
def test_add_existing_app_object(self):
self.assertEqual(self.app.queue, [])
app = BuildApp()
app.pool_size = 2
self.app.add(app)
self.assertIs(app, self.app.queue[0])
self.assertIsNot(app, BuildApp())
self.assertIsNot(BuildApp(), self.app.queue[0])
示例3: progress
# 需要导入模块: from libgiza.app import BuildApp [as 别名]
# 或者: from libgiza.app.BuildApp import pool_size [as 别名]
def progress(args):
conf = fetch_config(args)
app = BuildApp(conf)
app.pool = 'thread'
app.pool_size = 2
j = JeerahClient(conf)
j.connect()
query_data = giza.jeerah.progress.query(j, app, conf)
pprint(giza.jeerah.progress.report(query_data, conf))
示例4: actions
# 需要导入模块: from libgiza.app import BuildApp [as 别名]
# 或者: from libgiza.app.BuildApp import pool_size [as 别名]
def actions(args):
conf = fetch_config(args)
app = BuildApp(conf)
app.pool_size = 4
gh = get_connection(conf)
results = []
for pull in mine_github_pulls(gh, app, conf):
if pull['merge_safe'] is True:
results.append(pull)
pprint(results)
示例5: test_single_runner_app
# 需要导入模块: from libgiza.app import BuildApp [as 别名]
# 或者: from libgiza.app.BuildApp import pool_size [as 别名]
def test_single_runner_app(self):
self.assertEqual(self.app.queue, [])
self.assertEqual(self.app.results, [])
app = BuildApp()
app.pool_size = 2
t = app.add('task')
t.job = sum
t.args = [[1, 2], 0]
t.description = 'test task'
self.app.add(app)
self.app.run()
self.assertEqual(self.app.results[0], 3)
示例6: test_single_runner_app_with_many_subtasks
# 需要导入模块: from libgiza.app import BuildApp [as 别名]
# 或者: from libgiza.app.BuildApp import pool_size [as 别名]
def test_single_runner_app_with_many_subtasks(self):
self.assertEqual(self.app.queue, [])
self.assertEqual(self.app.results, [])
app = BuildApp()
app.pool_size = 2
for _ in range(10):
t = app.add('task')
t.job = sum
t.description = 'test task'
t.args = [[1, 2], 0]
self.app.add(app)
self.app.run()
self.assertEqual(len(self.app.results), 10)
self.assertEqual(self.app.results[0], 3)
self.assertEqual(sum(self.app.results), 30)
示例7: stats
# 需要导入模块: from libgiza.app import BuildApp [as 别名]
# 或者: from libgiza.app.BuildApp import pool_size [as 别名]
def stats(args):
conf = fetch_config(args)
app = BuildApp(conf)
app.pool_size = 4
gh = get_connection(conf)
users = set()
result = {'merge_safe': 0, 'total': 0}
for pull in mine_github_pulls(gh, app, conf):
result['total'] += 1
if pull['merge_safe'] is True:
result['merge_safe'] += 1
users.add(pull['user'])
result['user_count'] = len(users)
result['users'] = list(users)
pprint(result)