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


Python TextUtils.urlify方法代码示例

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


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

示例1: _get_directions_between_addresses_response

# 需要导入模块: from programy.utils.text.text import TextUtils [as 别名]
# 或者: from programy.utils.text.text.TextUtils import urlify [as 别名]
 def _get_directions_between_addresses_response(self, origin, destination, country, mode, units):
     origin = TextUtils.urlify(origin)
     destination = TextUtils.urlify(destination)
     url = GoogleMaps.DIRECTIONS.format(origin, destination, country, mode, units)
     return self._get_response_as_json(url)
开发者ID:Freiza,项目名称:program-y,代码行数:7,代码来源:google.py

示例2: _get_latlong_for_location_response

# 需要导入模块: from programy.utils.text.text import TextUtils [as 别名]
# 或者: from programy.utils.text.text.TextUtils import urlify [as 别名]
 def _get_latlong_for_location_response(self, location):
     location = TextUtils.urlify(location)
     url = GoogleMaps.GEOCODE.format(location)
     return self._get_response_as_json(url)
开发者ID:Freiza,项目名称:program-y,代码行数:6,代码来源:google.py

示例3: _get_distance_between_addresses

# 需要导入模块: from programy.utils.text.text import TextUtils [as 别名]
# 或者: from programy.utils.text.text.TextUtils import urlify [as 别名]
 def _get_distance_between_addresses(self, origin, destination, country, mode, units):
     origin = TextUtils.urlify(origin)
     destination = TextUtils.urlify(destination)
     url = GoogleMaps.DISTANCE.format(origin, destination, country, mode, units)
     return self._get_response_as_json(url)
开发者ID:Freiza,项目名称:program-y,代码行数:7,代码来源:google.py

示例4: test_urlify

# 需要导入模块: from programy.utils.text.text import TextUtils [as 别名]
# 或者: from programy.utils.text.text.TextUtils import urlify [as 别名]
 def test_urlify(self):
     self.assertEquals("", TextUtils.urlify(""))
     self.assertEquals("%20", TextUtils.urlify(" "))
     self.assertEquals("Hello%20World", TextUtils.urlify("Hello World"))
开发者ID:Freiza,项目名称:program-y,代码行数:6,代码来源:test_text.py


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