本文整理汇总了Python中utilities.execution_path函数的典型用法代码示例。如果您正苦于以下问题:Python execution_path函数的具体用法?Python execution_path怎么用?Python execution_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了execution_path函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setup
def setup():
# make the tests silent to suppress unsupported params from harfbuzz tests
# TODO: remove this after harfbuzz branch merges
mapnik.logger.set_severity(mapnik.severity_type.None)
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
开发者ID:kod3r,项目名称:mapnik,代码行数:7,代码来源:load_map_test.py
示例2: setup
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
开发者ID:Jeff885,项目名称:mapnik,代码行数:4,代码来源:sqlite_test.py
示例3: setup
#!/usr/bin/env python
from nose.tools import *
import atexit
import time
from utilities import execution_path, run_all
from subprocess import Popen, PIPE
import os, mapnik
from Queue import Queue
import threading
MAPNIK_TEST_DBNAME = 'mapnik-tmp-postgis-test-db'
POSTGIS_TEMPLATE_DBNAME = 'template_postgis'
SHAPEFILE = os.path.join(execution_path('.'),'../data/shp/world_merc.shp')
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
def call(cmd,silent=False):
stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
if not stderr:
return stdin.strip()
elif not silent and not 'NOTICE' in stderr:
raise RuntimeError(stderr.strip())
def psql_can_connect():
"""Test ability to connect to a postgis template db with no options.
开发者ID:FlavioFalcao,项目名称:mapnik,代码行数:30,代码来源:postgis_test.py
示例4: features
self.centre_x = centre_x
self.centre_y = centre_y
self.step = step
def features(self, query):
centre = (self.centre_x, self.centre_y)
return mapnik.PythonDatasource.wkt_features(
keys = (),
features = ConcentricCircles(centre, query.bbox, self.step)
)
if 'python' in mapnik.DatasourceCache.instance().plugin_names():
# make sure we can load from ourself as a module
sys.path.append(execution_path('.'))
def test_python_point_init():
ds = mapnik.Python(factory='python_plugin_test:PointDatasource')
e = ds.envelope()
assert_almost_equal(e.minx, 0, places=7)
assert_almost_equal(e.miny, -10, places=7)
assert_almost_equal(e.maxx, 100, places=7)
assert_almost_equal(e.maxy, 110, places=7)
def test_python_circle_init():
ds = mapnik.Python(factory='python_plugin_test:CirclesDatasource')
e = ds.envelope()
assert_almost_equal(e.minx, -180, places=7)
开发者ID:PierceCountyWA,项目名称:mapnik,代码行数:30,代码来源:python_plugin_test.py
示例5: setup
#!/usr/bin/env python
from nose.tools import *
import atexit
import time
from utilities import execution_path, run_all
from subprocess import Popen, PIPE
import os, mapnik
from Queue import Queue
import threading
MAPNIK_TEST_DBNAME = "mapnik-tmp-postgis-test-db"
POSTGIS_TEMPLATE_DBNAME = "template_postgis"
SHAPEFILE = os.path.join(execution_path("."), "../data/shp/world_merc.shp")
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path("."))
def call(cmd, silent=False):
stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
if not stderr:
return stdin.strip()
elif not silent and not "NOTICE" in stderr:
raise RuntimeError(stderr.strip())
开发者ID:Nobis99,项目名称:openstreetmap-tiles-docker,代码行数:29,代码来源:postgis_test.py
示例6: int
centre_y = int(centre_y)
step = int(step)
self.centre_x = centre_x
self.centre_y = centre_y
self.step = step
def features(self, query):
centre = (self.centre_x, self.centre_y)
return mapnik.PythonDatasource.wkt_features(keys=(), features=ConcentricCircles(centre, query.bbox, self.step))
if "python" in mapnik.DatasourceCache.plugin_names():
# make sure we can load from ourself as a module
sys.path.append(execution_path("."))
def test_python_point_init():
ds = mapnik.Python(factory="python_plugin_test:PointDatasource")
e = ds.envelope()
assert_almost_equal(e.minx, 0, places=7)
assert_almost_equal(e.miny, -10, places=7)
assert_almost_equal(e.maxx, 100, places=7)
assert_almost_equal(e.maxy, 110, places=7)
def test_python_circle_init():
ds = mapnik.Python(factory="python_plugin_test:CirclesDatasource")
e = ds.envelope()
assert_almost_equal(e.minx, -180, places=7)
开发者ID:soponpunth,项目名称:mapnik_nvpr,代码行数:31,代码来源:python_plugin_test.py
注:本文中的utilities.execution_path函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论