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


Python Point.place方法代码示例

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


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

示例1: __get_offices

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def __get_offices(self, url, city_name=''):
     points = []
     page = PQ(get_url(url).decode('utf8'))
     time = None
     for item in map(PQ, page('#oo__content_value table tr:gt(0)')):
         if item('td').attr('colspan') == '3':
             continue
         point = Point()
         point.prov = self.uid
         point.type = TYPE_OFFICE
         point.name = normalize_text(item('td:eq(0)').text())
         point.address = normalize_address(city_name + item('td:eq(1) p:eq(0)').text())
         place = item('td:eq(1) p:eq(2)').text()
         if not place:
             place = item('td:eq(1) p:eq(1)').text()
         if place:
             point.place = normalize_text(place)
         new_time = item('td:eq(2)').text()
         if new_time:
             time = new_time
         point.time = normalize_time(time)
         point.check_information = CHECK_OFFICIAL
         if point.address in self.__addresses:
             point.lat, point.lng = self.__addresses[point.address]
             point.check_coordinates = CHECK_OFFICIAL
         else:
             warning_not_official_coordinates(point)
         points.append(point)
     return points
开发者ID:tbicr,项目名称:BankParsers,代码行数:31,代码来源:bnb.py

示例2: get_offices

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
    def get_offices(self):
        points = []

        point = Point()
        point.prov = self.uid
        point.type = TYPE_OFFICE
        point.name = u'Главный офис'
        point.address = u'г. Минск, ул. Тимирязева, 65а'
        point.place = u'второй этаж'
        point.phones = [u'+375173121012', u'+375172863333']
        point.time = u'пн-чт: 08:30-17:30, пт: 08:30-16:15, перерыв: 13:00-13:45'
        point.check_information = CHECK_OFFICIAL
        if point.lat and point.lng:
            point.check_coordinates = CHECK_OFFICIAL
        else:
            warning_not_official_coordinates(point)
        points.append(point)

        point = Point()
        point.prov = self.uid
        point.type = TYPE_OFFICE
        point.name = u'ЦБУ №1'
        point.address = u'г. Минск, ул. Комсомольская, 26'
        point.phones = [u'+375172202622', u'+375172202722', u'+375172202422']
        point.time = u'пн-чт: 09:00-16:30, пт и предпраздничные дни: 09:30-15:00, перерыв: 13:00-13:45'
        point.check_information = CHECK_OFFICIAL
        if point.lat and point.lng:
            point.check_coordinates = CHECK_OFFICIAL
        else:
            warning_not_official_coordinates(point)
        points.append(point)

        return points
开发者ID:tbicr,项目名称:BankParsers,代码行数:35,代码来源:tc.py

示例3: __parse_base_atm_terminal

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def __parse_base_atm_terminal(self, row, point_type, coordinates, deposit=False):
     point = Point()
     point.prov = self.uid
     point.type = point_type
     point.name = normalize_text(u'№' + str(int(row[1])))
     city = row[2]
     if u'р-н' not in row[2]:
         city = u'г. %s' % city
     point.address = normalize_address(u'%s, %s' % (city, row[3]))
     point.place = normalize_text(row[4])
     if u'только безнал.платежи' in row[5]:
         point.currency = []
         if deposit:
             point.deposit = False
     else:
         point.currency = map(strip, row[5].split(','))
         if deposit:
             point.deposit = True
     point.time = normalize_time(row[6])
     point.check_information = CHECK_OFFICIAL
     point.lat, point.lng = self.__get_point_coordinate(point.address, coordinates)
     if point.lat and point.lng:
         point.check_coordinates = CHECK_OFFICIAL
     else:
         warning_not_official_coordinates(point)
     return point
开发者ID:tbicr,项目名称:BankParsers,代码行数:28,代码来源:prior.py

示例4: __parse_terminal

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
    def __parse_terminal(self, item):
        point = Point()
        point.prov = self.uid
        point.type = TYPE_TERMINAL

        city = normalize_text(item('td:eq(0)').text())
        address = normalize_text(item('td:eq(2)').text())
        point.address, point.place = split_address_place(u'г. %s, %s' % (city.title(), address))
        point.place = normalize_text(item('td:eq(1)').text())
        point.time = normalize_time(item('td:eq(3)').text())
        point.check_information = CHECK_OFFICIAL

        for lat, lng, type_id, description in self.__get_coordinates():
            if u'Минск' not in point.address or type_id != '2':
                continue
            for token in description.split():
                if token not in point.address:
                    break
            else:
                point.lat = lat
                point.lng = lng
                point.check_coordinates = CHECK_OFFICIAL
                break
        else:
            warning_not_official_coordinates(point)
        return point
开发者ID:umax,项目名称:BankParsers,代码行数:28,代码来源:bveb.py

示例5: __parse_terminal

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def __parse_terminal(self, item):
     point = Point()
     point.prov = self.uid
     point.type = TYPE_TERMINAL
     city = u'г. %s' % normalize_text(item('td:eq(0)').text()).title()
     point.address = normalize_address(u'%s, %s' % (city, item('td:eq(1)').text()))
     point.place = normalize_text(item('td:eq(2)').text())
     point.time = normalize_time(item('td:eq(3)').text())
     point.check_information = CHECK_OFFICIAL
     warning_not_official_coordinates(point)
     return point
开发者ID:tbicr,项目名称:BankParsers,代码行数:13,代码来源:rrb.py

示例6: __parse_atm

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def __parse_atm(self, item):
     point = Point()
     point.prov = self.uid
     point.type = TYPE_ATM
     point.address, point.place = split_address_place(item('td:eq(2)').text())
     point.place = normalize_text(item('td:eq(1)').text())
     point.currency = map(strip, item('td:eq(4)').text().split(','))
     point.time = normalize_time(item('td:eq(3)').text())
     point.check_information = CHECK_OFFICIAL
     warning_not_official_coordinates(point)
     return point
开发者ID:tbicr,项目名称:BankParsers,代码行数:13,代码来源:trust.py

示例7: __parse_terminal

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def __parse_terminal(self, item):
     point = Point()
     point.prov = self.uid
     point.type = TYPE_TERMINAL
     point.name = normalize_text(item('td:eq(0)').text())
     point.address, point.place = split_address_place(item('td:eq(1)').text())
     point.place = point.name
     point.time = normalize_time(item('td:eq(2)').text())
     point.deposit = normalize_text(item('td:eq(3)').text()).lower() == u'есть'
     point.check_information = CHECK_OFFICIAL
     warning_not_official_coordinates(point)
     return point
开发者ID:tbicr,项目名称:BankParsers,代码行数:14,代码来源:belarus.py

示例8: __parse_atm

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def __parse_atm(self, item, city, coordinates):
     point = Point()
     point.prov = self.uid
     point.type = TYPE_ATM
     point.address = normalize_address(u'%s, %s' % (city, item('td:eq(2)').text()))
     point.place = normalize_text(item('td:eq(1)').text())
     point.currency = map(strip, item('td:eq(4)').text().replace('EURO', 'EUR').split(','))
     point.time = normalize_time(item('td:eq(3)').text())
     point.check_information = CHECK_OFFICIAL
     point.lat, point.lng = self.__get_point_coordinate(point, coordinates)
     if point.lat and point.lng:
         point.check_coordinates = CHECK_OFFICIAL
     else:
         warning_not_official_coordinates(point)
     return point
开发者ID:tbicr,项目名称:BankParsers,代码行数:17,代码来源:tb.py

示例9: get_atms

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def get_atms(self):
     points = []
     page = PQ(get_url(self.__parse_list_atm_url).decode('utf8'))
     for item in map(PQ, page('#oo__content_value table tr:gt(0)')):
         point = Point()
         point.prov = self.uid
         point.type = TYPE_ATM
         point.address = normalize_address(item('td:eq(0) p:eq(0)').text())
         point.place = normalize_text(item('td:eq(1)').text())
         point.time = normalize_time(item('td:eq(2)').text())
         point.currency = map(self.__get_currency, item('td:eq(3) p'))
         point.check_information = CHECK_OFFICIAL
         if point.address in self.__addresses:
             point.lat, point.lng = self.__addresses[point.address]
             point.check_coordinates = CHECK_OFFICIAL
         else:
             warning_not_official_coordinates(point)
         points.append(point)
     return points
开发者ID:tbicr,项目名称:BankParsers,代码行数:21,代码来源:bnb.py

示例10: get_exchanges

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def get_exchanges(self):
     points = []
     page = PQ(get_url(self.__parse_list_exchange_url).decode('utf8'))
     for item in map(PQ, page('#oo__content_value table tr:gt(0)')):
         point = Point()
         point.prov = self.uid
         point.type = TYPE_EXCHANGE
         add_city_literal = (u'Минск', u'Витебск')
         address = normalize_text(item('td:eq(0)').text())
         point.address = normalize_address((u'г. ' + address) if address.startswith(add_city_literal) else address)
         point.place = normalize_text(item('td:eq(1)').text())
         point.time = normalize_time(item('td:eq(2)').text())
         point.check_information = CHECK_OFFICIAL
         if point.address in self.__addresses:
             point.lat, point.lng = self.__addresses[point.address]
             point.check_coordinates = CHECK_OFFICIAL
         else:
             warning_not_official_coordinates(point)
         points.append(point)
     return points
开发者ID:tbicr,项目名称:BankParsers,代码行数:22,代码来源:bnb.py

示例11: __parse_atm

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def __parse_atm(self, item, city):
     point = Point()
     point.prov = self.uid
     point.type = TYPE_ATM
     address = item('th .pointShowMaps span').remove().text()
     place = normalize_text(item('th .pointShowMaps').text())
     point.address, point.place = split_address_place(u'г. %s, %s' % (city, address))
     point.place = place
     currency = item('td:eq(0)').text()
     for from_token, to_token in self.__currency_replaces:
         currency = currency.replace(from_token, to_token)
     point.currency = map(strip, currency.split(','))
     time_html = replace_br(item('td:eq(1)').html(), ', ')
     point.time = normalize_time(PQ(time_html).text())
     point.lat = normalize_text(item('th .item_coords .coord1').text())
     point.lng = normalize_text(item('th .item_coords .coord2').text())
     point.check_information = CHECK_OFFICIAL
     if point.lat and point.lng:
         point.check_coordinates = CHECK_OFFICIAL
     else:
         warning_not_official_coordinates(point)
     return point
开发者ID:tbicr,项目名称:BankParsers,代码行数:24,代码来源:mm.py

示例12: __parse_base_atm_terminals

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
    def __parse_base_atm_terminals(self, item, map_points, point_type, start_names):
        point = Point()
        point.prov = self.uid
        point.type = point_type
        if not item('.name').text().split()[0].startswith(start_names):
            return None

        point.address, point.place = split_address_place(' '.join(item('.name').text().strip().split()[1:]))
        point.place = trim_spaces_and_commas(normalize_text(item('.addres strong').text()))
        point.check_information = CHECK_OFFICIAL

        for lat, lng, name, address, place in map_points:
            if (name in start_names) and\
               (point.address and address and point.address in address) and\
               (point.place in place if point.place and place else True):
                point.lat = lat
                point.lng = lng
                point.check_coordinates = CHECK_OFFICIAL
                break
        else:
            warning_not_official_coordinates(point)
        return point
开发者ID:umax,项目名称:BankParsers,代码行数:24,代码来源:belinvest.py

示例13: __parse_office_exchange

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
 def __parse_office_exchange(self, item, city, coordinates, point_type, point_keywords):
     point = Point()
     point.prov = self.uid
     point.type = point_type
     point.name = normalize_text(item('th:eq(0)').text())
     if not point.name.startswith(point_keywords):
         return None
     address_html = replace_br(item('td:eq(0)').html(), ';;;')
     address_items = PQ(address_html).text().split(';;;', 1)
     point.address = normalize_address(u'%s, %s' % (city, address_items[0]))
     if len(address_items) > 1:
         point.place = normalize_text(address_items[1])
     item('td:eq(1) ul, td:eq(1) li').remove()
     point.time = normalize_time(item('td:eq(1)').text())
     point.phones = normalize_phones(map(lambda phone_item: PQ(phone_item).text(), item('td:eq(2) p') or item('td:eq(2)')))
     point.check_information = CHECK_OFFICIAL
     point.lat, point.lng = self.__get_point_coordinate(point, coordinates)
     if point.lat and point.lng:
         point.check_coordinates = CHECK_OFFICIAL
     else:
         warning_not_official_coordinates(point)
     return point
开发者ID:tbicr,项目名称:BankParsers,代码行数:24,代码来源:tb.py

示例14: __parse_exchange

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
    def __parse_exchange(self, item):
        point = Point()
        point.prov = self.uid
        point.type = TYPE_EXCHANGE
        point.name = normalize_text(item.find('name').text)

        city = item.find('region').text if item.find('region') else u'Минск'
        address = item.find('address').text
        point.address = normalize_address(u'г. %s, %s' % (city.title(), address))
        point.place = normalize_text(item.find('location').text)
        point.lat = item.find('lattitude').text
        point.lng = item.find('longitude').text
        point.time = normalize_time(item.find('time').text)
        if item.find('phones').text:
            point.phones = normalize_phones(item.find('phones').text.split(','))
        point.check_information = CHECK_OFFICIAL

        if point.lat and point.lng:
            point.check_coordinates = CHECK_OFFICIAL
        else:
            warning_not_official_coordinates(point)
        return point
开发者ID:umax,项目名称:BankParsers,代码行数:24,代码来源:bsb.py

示例15: __parse_atm

# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import place [as 别名]
    def __parse_atm(self, item, coordinates):
        point = Point()
        point.prov = self.uid
        point.type = TYPE_ATM
        bank = item.find('bank').text
        if bank != u'ЗАО БелСвиссБанк':
            return None

        city = item.find('region').text
        address = item.find('address').text
        point.address = normalize_address(u'г. %s, %s' % (city.title(), address))
        point.place = normalize_text(item.find('location').text)
        point.time = normalize_time(item.find('time').text)
        point.currency = map(strip, item.find('currency').text.split(','))
        point.check_information = CHECK_OFFICIAL

        terminal_id = item.find('terminal_id').text
        if terminal_id in coordinates:
            point.lat, point.lng = coordinates[terminal_id]
        if point.lat and point.lng:
            point.check_coordinates = CHECK_OFFICIAL
        else:
            warning_not_official_coordinates(point)
        return point
开发者ID:umax,项目名称:BankParsers,代码行数:26,代码来源:bsb.py


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