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

Python utilities.execution_path函数代码示例

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

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python utilities.float_gt函数代码示例发布时间:2022-05-26
下一篇:
Python utilities.disable_bdb_cache函数代码示例发布时间: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