本文整理汇总了Python中model.Point.phone方法的典型用法代码示例。如果您正苦于以下问题:Python Point.phone方法的具体用法?Python Point.phone怎么用?Python Point.phone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Point
的用法示例。
在下文中一共展示了Point.phone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_offices
# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import phone [as 别名]
def get_offices(self):
points = []
items_tree = ET.fromstring(get_url(self.__offices_xml_url))
for item in items_tree.iter('item'):
point = self.__parse_office(item)
if point:
points.append(point)
page = PQ(get_url(self.__regional_offices_page_url))
point = None
for item in map(PQ, page('#content_internal span:eq(0)').children()):
if item[0].tag not in self.__regional_offices_tags:
continue
if item[0].tag == 'h2':
point = Point()
point.prov = self.uid
point.type = TYPE_OFFICE
point.name = trim_spaces_and_commas(normalize_text(item.text()))
point.check_information = CHECK_OFFICIAL
continue
if not point:
continue
item_html = replace_br(item.html(), ';;;')
sub_items = PQ(item_html).text().split(';;;')
point.address, point.place = split_address_place(sub_items[0])
for sub_item in map(normalize_text, sub_items[1:]):
if sub_item.startswith(u'т.ф.:'):
point.phone = normalize_phones(sub_item[len(u'т.ф.:'):].split(','))
warning_not_official_coordinates(point)
points.append(point)
point = None
return points