Skip to content

Commit 3ebb5af

Browse files
Gustrynyalldawson
authored andcommittedApr 18, 2023
Python - Upgrade metasearch to Python 3.7 minimum
1 parent cf77ddb commit 3ebb5af

File tree

12 files changed

+12
-28
lines changed

12 files changed

+12
-28
lines changed
 

‎python/plugins/MetaSearch/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# Copyright (C) 2010 NextGIS (http://nextgis.org),

‎python/plugins/MetaSearch/dialogs/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com)

‎python/plugins/MetaSearch/dialogs/apidialog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# CSW Client

‎python/plugins/MetaSearch/dialogs/maindialog.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# CSW Client
@@ -985,12 +984,12 @@ def install_proxy(self):
985984
proxy_port = ''
986985

987986
if all([user != '', password != '']):
988-
proxy_up = '%s:%s@' % (user, password)
987+
proxy_up = f'{user}:{password}@'
989988

990989
if port != '':
991990
proxy_port = ':%s' % port
992991

993-
conn = '%s://%s%s%s' % (ptype, proxy_up, host, proxy_port)
992+
conn = f'{ptype}://{proxy_up}{host}{proxy_port}'
994993
install_opener(build_opener(ProxyHandler({ptype: conn})))
995994

996995

‎python/plugins/MetaSearch/dialogs/manageconnectionsdialog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# CSW Client

‎python/plugins/MetaSearch/dialogs/newconnectiondialog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# CSW Client

‎python/plugins/MetaSearch/dialogs/recorddialog.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# CSW Client

‎python/plugins/MetaSearch/link_types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# MetaSearch Catalog Client

‎python/plugins/MetaSearch/pavement.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# Copyright (C) 2014 Tom Kralidis (tomkralidis@gmail.com)
@@ -151,8 +150,7 @@ def upload():
151150
options.upload.port,
152151
options.upload.endpoint)
153152

154-
info('Uploading to http://%s/%s' % (options.upload.host,
155-
options.upload.endpoint))
153+
info('Uploading to http://{}/{}'.format(options.upload.host, options.upload.endpoint))
156154

157155
server = xmlrpc.client.ServerProxy(url, verbose=False)
158156

@@ -225,6 +223,6 @@ def generate_csw_connections_file():
225223
def get_package_filename():
226224
"""return filepath of plugin zipfile"""
227225

228-
filename = '%s-%s.zip' % (PLUGIN_NAME, options.base.version)
229-
package_file = '%s/%s' % (options.base.tmp, filename)
226+
filename = f'{PLUGIN_NAME}-{options.base.version}.zip'
227+
package_file = f'{options.base.tmp}/{filename}'
230228
return package_file

‎python/plugins/MetaSearch/plugin.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from builtins import object
2-
# -*- coding: utf-8 -*-
31
###############################################################################
42
#
53
# Copyright (C) 2010 NextGIS (http://nextgis.org),
@@ -37,7 +35,7 @@
3735
LOGGER = logging.getLogger('MetaSearch')
3836

3937

40-
class MetaSearchPlugin(object):
38+
class MetaSearchPlugin:
4139
"""base plugin"""
4240

4341
def __init__(self, iface):
@@ -54,8 +52,7 @@ def initGui(self):
5452
"""startup"""
5553

5654
# run
57-
run_icon = QIcon('%s/%s' % (self.context.ppath,
58-
'images/MetaSearch.svg'))
55+
run_icon = QIcon('{}/{}'.format(self.context.ppath, 'images/MetaSearch.svg'))
5956
self.action_run = QAction(run_icon, 'MetaSearch',
6057
self.iface.mainWindow())
6158
self.action_run.setWhatsThis(

‎python/plugins/MetaSearch/search_backend.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# CSW Client

‎python/plugins/MetaSearch/util.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
###############################################################################
32
#
43
# Copyright (C) 2010 NextGIS (http://nextgis.org),
@@ -49,7 +48,7 @@
4948
LOGGER = logging.getLogger('MetaSearch')
5049

5150

52-
class StaticContext(object):
51+
class StaticContext:
5352
"""base configuration / scaffolding"""
5453

5554
def __init__(self):
@@ -59,8 +58,7 @@ def __init__(self):
5958

6059
def get_ui_class(ui_file):
6160
"""return class object of a uifile"""
62-
ui_file_full = '%s%sui%s%s' % (os.path.dirname(os.path.abspath(__file__)),
63-
os.sep, os.sep, ui_file)
61+
ui_file_full = '{}{}ui{}{}'.format(os.path.dirname(os.path.abspath(__file__)), os.sep, os.sep, ui_file)
6462
return loadUiType(ui_file_full)[0]
6563

6664

@@ -88,7 +86,7 @@ def get_connections_from_file(parent, filename):
8886
except etree.ParseError as err:
8987
error = 1
9088
msg = parent.tr('Cannot parse XML file: {0}').format(err)
91-
except IOError as err:
89+
except OSError as err:
9290
error = 1
9391
msg = parent.tr('Cannot open file: {0}').format(err)
9492

@@ -142,7 +140,7 @@ def get_help_url():
142140
else:
143141
version = '.'.join([major, minor])
144142

145-
path = '%s/%s/docs/user_manual/plugins/core_plugins/plugins_metasearch.html' % (version, locale_name) # noqa
143+
path = f'{version}/{locale_name}/docs/user_manual/plugins/core_plugins/plugins_metasearch.html' # noqa
146144

147145
return '/'.join(['https://docs.qgis.org', path])
148146

@@ -168,7 +166,7 @@ def serialize_string(input_string):
168166
all_other_tokens_as_string = input_string.replace(last_token, '')
169167

170168
if last_token.isdigit():
171-
value = '%s%s' % (all_other_tokens_as_string, int(last_token) + 1)
169+
value = f'{all_other_tokens_as_string}{int(last_token) + 1}'
172170
else:
173171
value = '%s 1' % input_string
174172

0 commit comments

Comments
 (0)
Please sign in to comment.