Skip to content

Commit

Permalink
Remove unicode prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LKajan committed Nov 17, 2023
1 parent 045a81b commit 42eba4c
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions nlsgpkgloader/nls_geopackage_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(self):

# Declare instance attributes
self.actions = []
self.menu = self.tr(u"&NLS GeoPackage Downloader")
self.menu = self.tr("&NLS GeoPackage Downloader")

# Check if plugin was started the first time in current QGIS session
# Must be set in initGui() to survive plugin reloads
Expand Down Expand Up @@ -200,7 +200,7 @@ def initGui(self): # noqa N802

self.add_action(
resources_path("icons", "icon.png"),
text=self.tr(u"NLS GeoPackage Downloader"),
text=self.tr("NLS GeoPackage Downloader"),
callback=self.run,
parent=self.iface.mainWindow(),
)
Expand All @@ -220,7 +220,7 @@ def _migrate_settings():
def unload(self):
"""Removes the plugin menu item and icon from QGIS GUI."""
for action in self.actions:
self.iface.removePluginMenu(self.tr(u"&NLS GeoPackage Downloader"), action)
self.iface.removePluginMenu(self.tr("&NLS GeoPackage Downloader"), action)
self.iface.removeToolBarIcon(action)

def run(self):
Expand Down Expand Up @@ -249,8 +249,8 @@ def run(self):
if not self.load_layers():
QMessageBox.critical(
self.iface.mainWindow(),
self.tr(u"Failed to load data"),
self.tr(u"Check that necessary files exist in data folder"),
self.tr("Failed to load data"),
self.tr("Check that necessary files exist in data folder"),
)
return

Expand Down Expand Up @@ -292,8 +292,8 @@ def run(self):
if self.fileName == "":
QMessageBox.critical(
self.iface.mainWindow(),
self.tr(u"Invalid filename"),
self.tr(u"Please enter a filename"),
self.tr("Invalid filename"),
self.tr("Please enter a filename"),
)
return
if self.fileName.split(".")[-1].lower() != "gpkg":
Expand Down Expand Up @@ -391,8 +391,8 @@ def run(self):
self.progress_dialog.hide()
QMessageBox.critical(
self.iface.mainWindow(),
self.tr(u"Invalid selection"),
self.tr(u"Found nothing to download!"),
self.tr("Invalid selection"),
self.tr("Found nothing to download!"),
)
return

Expand Down Expand Up @@ -673,7 +673,7 @@ def get_intersecting_features(self, features, layer, selected_mun_names=None):
if selected_mun_names:
expression = ""
for mun in selected_mun_names:
expression += u'"NAMEFIN" = \'' + mun + u"' OR "
expression += '"NAMEFIN" = \'' + mun + "' OR "
expression = expression[:-4]

iter = self.municipality_layer.getFeatures(expression)
Expand All @@ -694,7 +694,6 @@ def get_intersecting_features(self, features, layer, selected_mun_names=None):
self.utm25lr_features.append(layer_feature)

def download_data(self, product_types):

self.all_urls = []
self.total_download_count = 0
self.download_count = 0
Expand Down Expand Up @@ -858,9 +857,8 @@ def finish_processing(self):
)
)
self.iface.messageBar().pushMessage(
self.tr(u"GeoPackage creation finished"),
self.tr(u"NLS data download finished. Data located under ")
+ self.gpkg_path,
self.tr("GeoPackage creation finished"),
self.tr("NLS data download finished. Data located under ") + self.gpkg_path,
level=3,
)
self.progress_dialog.hide()
Expand All @@ -887,8 +885,8 @@ def show_settings_dialog(self):
# cannot work without the key, so user needs to be notified
QMessageBox.critical(
self.iface.mainWindow(),
self.tr(u"User-key is needed"),
self.tr(u"Data cannot be downloaded without the NLS key"),
self.tr("User-key is needed"),
self.tr("Data cannot be downloaded without the NLS key"),
)
return False
self.data_download_dir = (
Expand All @@ -903,8 +901,8 @@ def show_settings_dialog(self):
# cannot work without the key, so user needs to be notified
QMessageBox.critical(
self.iface.mainWindow(),
self.tr(u"User-key is needed"),
self.tr(u"Data cannot be downloaded without the NLS key"),
self.tr("User-key is needed"),
self.tr("Data cannot be downloaded without the NLS key"),
)
return False

Expand Down

0 comments on commit 42eba4c

Please sign in to comment.