Skip to content

Commit

Permalink
Fix PEP 8 coding style violations
Browse files Browse the repository at this point in the history
refers to #133
  • Loading branch information
TheGreatRefrigerator committed Jun 8, 2021
1 parent 717895d commit 1fe1e0c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions ORStools/common/isochrones_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def __init__(self):

def set_parameters(self, profile, dimension, factor, id_field_type=QVariant.String, id_field_name='ID'):
"""
Sets all parameters defined in __init__, because processing algorithm calls this class when it doesn't know its parameters yet.
Sets all parameters defined in __init__, because processing algorithm calls this class when it doesn't know
its parameters yet.
:param profile: Transportation mode being used
:type profile: str
Expand Down Expand Up @@ -116,8 +117,7 @@ def get_features(self, response, id_field_value):

# Sort features based on the isochrone value, so that longest isochrone
# is added first. This will plot the isochrones on top of each other.
l = lambda x: x['properties']['value']
for isochrone in sorted(response['features'], key=l, reverse=True):
for isochrone in sorted(response['features'], key=lambda x: x['properties']['value'], reverse=True):
feat = QgsFeature()
coordinates = isochrone['geometry']['coordinates']
iso_value = isochrone['properties']['value']
Expand Down
18 changes: 11 additions & 7 deletions ORStools/gui/ORStoolsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,18 @@ def on_help_click():
def on_about_click(parent):
"""Slot for click event of About button/menu entry."""

info = f'<b>ORS Tools</b> provides access to <a href="https://openrouteservice.org" style="color: {DEFAULT_COLOR}">openrouteservice</a> routing functionalities.<br><br>' \
info = f'<b>ORS Tools</b> provides access to <a href="https://openrouteservice.org"' \
f' style="color: {DEFAULT_COLOR}">openrouteservice</a> routing functionalities.' \
f'<br><br>' \
f'<center>' \
f'<a href=\"https://heigit.org/de/willkommen\"><img src=\":/plugins/ORStools/img/logo_heigit_300.png\"/></a> <br><br>' \
f'<a href=\"https://heigit.org/de/willkommen\"><img src=\":/plugins/ORStools/img/logo_heigit_300.png\"/>' \
f'</a><br><br>' \
f'</center>' \
f'Author: HeiGIT gGmbH<br>' \
f'Email: <a href="mailto:Openrouteservice <{__email__}>">{__email__}</a><br>' \
f'Web: <a href="{__web__}">{__web__}</a><br>' \
f'Repo: <a href="https://github.com/GIScience/orstools-qgis-plugin">github.com/GIScience/orstools-qgis-plugin</a><br>' \
f'Repo: <a href="https://github.com/GIScience/orstools-qgis-plugin">' \
f'github.com/GIScience/orstools-qgis-plugin</a><br>' \
f'Version: {__version__}'

QMessageBox.information(
Expand Down Expand Up @@ -258,9 +262,9 @@ def run_gui_control(self):
"""
Did you forget to set an <b>API key</b> for openrouteservice?<br><br>
If you don't have an API key, please visit https://openrouteservice.org/sign-up to get one. <br><br>
Then enter the API key for openrouteservice provider in Web ► ORS Tools ► Provider Settings or the settings symbol in the main ORS Tools GUI, next to the provider dropdown.
"""
If you don't have an API key, please visit https://openrouteservice.org/sign-up to get one. <br><br>
Then enter the API key for openrouteservice provider in Web ► ORS Tools ► Provider Settings or the
settings symbol in the main ORS Tools GUI, next to the provider dropdown."""
)
return

Expand Down Expand Up @@ -379,7 +383,7 @@ def __init__(self, iface, parent=None):
self.global_buttons.button(QDialogButtonBox.Ok).setText('Apply')
self.global_buttons.button(QDialogButtonBox.Cancel).setText('Close')

#### Set up signals/slots ####
# Set up signals/slots

# Config/Help dialogs
self.provider_config.clicked.connect(lambda: on_config_click(self))
Expand Down
2 changes: 1 addition & 1 deletion ORStools/proc/isochrones_layer_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def processAlgorithm(self, parameters, context, feedback):

# LookupField will return -1 if the name cannot be found.
# Try the first field in this case.
if id_field_id == -1:
if id_field_id == -1:
id_field_id = 0

# Populate iso_layer instance with parameters
Expand Down

0 comments on commit 1fe1e0c

Please sign in to comment.