本文整理汇总了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
示例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
示例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("/", "/", "\\"))