本文整理匯總了Python中hypermap.aggregator.models.Service.check_available方法的典型用法代碼示例。如果您正苦於以下問題:Python Service.check_available方法的具體用法?Python Service.check_available怎麽用?Python Service.check_available使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hypermap.aggregator.models.Service
的用法示例。
在下文中一共展示了Service.check_available方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUp
# 需要導入模塊: from hypermap.aggregator.models import Service [as 別名]
# 或者: from hypermap.aggregator.models.Service import check_available [as 別名]
def setUp(self):
signals.post_save.disconnect(layer_post_save, sender=Layer)
signals.post_save.disconnect(service_post_save, sender=Service)
for s in range(0, SERVICE_NUMBER):
service = Service(
url='http://%s.fakeurl.com' % s,
title='Title %s' % s,
type='OGC:WMS',
)
service.save()
for l in range(0, LAYER_PER_SERVICE_NUMBER):
layer = Layer(
name='Layer %s, from service %s' % (l, s),
bbox_x0=-179,
bbox_x1=179,
bbox_y0=-89,
bbox_y1=89,
service=service
)
layer.save()
service.layer_set.add(layer)
for c in range(0, TIMES_TO_CHECK):
for s in range(0, SERVICE_NUMBER):
service = Service.objects.all()[s]
service.check_available()
for layer in service.layer_set.all():
layer.check_available()
示例2: setUp
# 需要導入模塊: from hypermap.aggregator.models import Service [as 別名]
# 或者: from hypermap.aggregator.models.Service import check_available [as 別名]
def setUp(self):
signals.post_save.disconnect(layer_post_save, sender=Layer)
signals.post_save.disconnect(service_post_save, sender=Service)
catalog, created = Catalog.objects.get_or_create(
name="hypermap", slug="hypermap",
url="search_api"
)
for s in range(0, SERVICE_NUMBER):
service = Service(
url='http://%s.fakeurl.com' % s,
title='Title %s' % s,
type='OGC:WMS',
catalog=catalog
)
service.save()
for l in range(0, LAYER_PER_SERVICE_NUMBER):
layer = Layer(
name='Layer %s, from service %s' % (l, s),
bbox_x0=-179,
bbox_x1=179,
bbox_y0=-89,
bbox_y1=89,
service=service,
catalog=service.catalog
)
layer.save()
service.layer_set.add(layer)
for c in range(0, TIMES_TO_CHECK):
for s in range(0, SERVICE_NUMBER):
service = Service.objects.all()[s]
service.check_available()
for layer in service.layer_set.all():
layer.check_available()