当前位置: 首页>>代码示例>>Python>>正文


Python TextUtils.replace_path_seperator方法代码示例

本文整理汇总了Python中programy.utils.text.text.TextUtils.replace_path_seperator方法的典型用法代码示例。如果您正苦于以下问题:Python TextUtils.replace_path_seperator方法的具体用法?Python TextUtils.replace_path_seperator怎么用?Python TextUtils.replace_path_seperator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在programy.utils.text.text.TextUtils的用法示例。


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

示例1: LicenseKeys

# 需要导入模块: from programy.utils.text.text import TextUtils [as 别名]
# 或者: from programy.utils.text.text.TextUtils import replace_path_seperator [as 别名]
import os

from programy.utils.text.text import TextUtils
from programy.utils.geo.google import GoogleMaps
from programy.utils.license.keys import LicenseKeys

if __name__ == '__main__':

    license_keys = LicenseKeys()
    license_keys.load_license_key_file(os.path.dirname(__file__) + TextUtils.replace_path_seperator('/../../../../bots/y-bot/config/license.keys'))

    # Only to be used to create test data for unit aiml_tests
    googlemaps = GoogleMaps(license_keys)

    # Running these tools drops test files into the geocode test folder
    googlemaps.store_get_latlong_for_location_to_file("KY3 9UR", TextUtils.replace_path_seperator(
        "../../../test/utils/geo/google_latlong.json"))
    googlemaps.store_get_distance_between_addresses_as_file("Edinburgh", "Kinghorn", TextUtils.replace_path_seperator(
        "../../../test/utils/geo/distance.json"))
    googlemaps.store_get_directions_between_addresses_as_file("Edinburgh", "Kinghorn", TextUtils.replace_path_seperator(
        "../../../test/utils/geo/directions.json"))

    googlemaps.store_get_latlong_for_location_to_file("KY3 9UR", TextUtils.replace_path_seperator(
        "../../../test/utils/weather/google_latlong.json"))
    googlemaps.store_get_distance_between_addresses_as_file("Edinburgh", "Kinghorn", TextUtils.replace_path_seperator(
        "../../../test/utils/weather/distance.json"))
    googlemaps.store_get_directions_between_addresses_as_file("Edinburgh", "Kinghorn", TextUtils.replace_path_seperator(
        "../../../test/utils/weather/directions.json"))
    # Only to be used to create test data for unit aiml_tests
开发者ID:Freiza,项目名称:program-y,代码行数:31,代码来源:googledata.py

示例2: LicenseKeys

# 需要导入模块: from programy.utils.text.text import TextUtils [as 别名]
# 或者: from programy.utils.text.text.TextUtils import replace_path_seperator [as 别名]
import os

from programy.utils.text.text import TextUtils
from programy.utils.geo.geonames import GeoNamesApi
from programy.utils.license.keys import LicenseKeys

if __name__ == '__main__':

    # Only to be used to create test data for unit aiml_tests

    license_keys = LicenseKeys()
    license_keys.load_license_key_file(os.path.dirname(__file__) + TextUtils.replace_path_seperator('/../../../../bots/y-bot/config/license.keys'))

    geonamesapi = GeoNamesApi(license_keys)

    # Running these tools drops test files into the geocode test folder
    geonamesapi.store_get_latlong_for_postcode_to_file("KY39UR", TextUtils.replace_path_seperator("../../../test/utils/geocode/geonames_latlong.json"))
    geonamesapi.store_get_latlong_for_postcode_to_file("KY39UR", TextUtils.replace_path_seperator("../../../test/utils/geo/geonames_latlong.json"))

    # Only to be used to create test data for unit aiml_tests

开发者ID:Freiza,项目名称:program-y,代码行数:22,代码来源:geonames.py

示例3: test_replace_path_seperator

# 需要导入模块: from programy.utils.text.text import TextUtils [as 别名]
# 或者: from programy.utils.text.text.TextUtils import replace_path_seperator [as 别名]
 def test_replace_path_seperator(self):
     self.assertEquals("", TextUtils.replace_path_seperator(""))
     self.assertEquals(" ", TextUtils.replace_path_seperator(" "))
     self.assertEquals(os.sep, TextUtils.replace_path_seperator("/"))
     self.assertEquals(".."+os.sep, TextUtils.replace_path_seperator("../"))
     self.assertEquals("\\", TextUtils.replace_path_seperator("/", "/", "\\"))
开发者ID:Freiza,项目名称:program-y,代码行数:8,代码来源:test_text.py


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