|
3 | 3 | __version__ = "0.5.0" |
4 | 4 |
|
5 | 5 | from json import dumps |
6 | | -from typing import Optional, Dict, Any, List, Union, Tuple, Text |
| 6 | +from typing import Optional, Dict, Any, List, Union, Tuple, Text # noqa: F401 |
7 | 7 |
|
8 | 8 | import requests |
9 | 9 | from flask import Blueprint, g, render_template |
@@ -226,7 +226,7 @@ def build_rectangle_dict( |
226 | 226 | def add_rectangle( |
227 | 227 | self, north=None, west=None, south=None, east=None, **kwargs |
228 | 228 | ): |
229 | | - # type: (Optional[float], Optional[float], Optional[float], Optional[float], **Any) -> None |
| 229 | + # type: (Optional[float], Optional[float], Optional[float], Optional[float], **Any) -> None # noqa E501 |
230 | 230 | """Adds a rectangle dict to the Map.rectangles attribute |
231 | 231 |
|
232 | 232 | The Google Maps API describes a rectangle using the LatLngBounds |
@@ -714,14 +714,16 @@ def build_heatmap(self, heatmap_data, heatmap_layer): |
714 | 714 | raise AttributeError("heatmap_later requires 'heatmap_data'") |
715 | 715 | if not isinstance(heatmap_data, (list)): |
716 | 716 | raise AttributeError( |
717 | | - "heatmap_data only accepts a list of dicts with keys 'lat' 'lng' and their corresponding values" |
| 717 | + "heatmap_data only accepts a list of dicts with keys " |
| 718 | + "'lat' 'lng' and their corresponding values" |
718 | 719 | ) |
719 | 720 | for hm in heatmap_data: |
720 | 721 | if isinstance(hm, dict): |
721 | 722 | self.add_heatmap(**hm) |
722 | 723 | else: |
723 | 724 | raise AttributeError( |
724 | | - "elements of list 'heatmap_data' must be a dict of keys 'lat' and 'lng' with their corresponding values" |
| 725 | + "elements of list 'heatmap_data' must be a dict of keys " |
| 726 | + "'lat' and 'lng' with their corresponding values" |
725 | 727 | ) |
726 | 728 |
|
727 | 729 | def add_heatmap(self, lat=None, lng=None, **kwargs): |
@@ -820,7 +822,7 @@ def set_googlemaps_loaded(): |
820 | 822 | def get_address(API_KEY, lat, lon): |
821 | 823 | # type: (str, float, float) -> dict |
822 | 824 | add_dict = dict() |
823 | | - response = rq.get( |
| 825 | + response = requests.get( |
824 | 826 | "https://maps.googleapis.com/maps/api/geocode/json?latlng=" |
825 | 827 | + ",".join(map(str, [lat, lon])) |
826 | 828 | + "&key=" |
|
0 commit comments