本文整理匯總了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