From 3ec8997c92b2680c8076aada35581cfc19d61498 Mon Sep 17 00:00:00 2001 From: Tim Meehan Date: Fri, 29 Jan 2021 23:31:59 -0600 Subject: [PATCH 1/2] Replace concatenated string with triple quoted string. It is possible to use a triple quoted string and avoid '+'ing all of the strings together. --- protonvpn_cli/utils.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/protonvpn_cli/utils.py b/protonvpn_cli/utils.py index b1d9487..4e14c97 100644 --- a/protonvpn_cli/utils.py +++ b/protonvpn_cli/utils.py @@ -9,6 +9,7 @@ import random import ipaddress import math +from textwrap import dedent # External Libraries import requests from jinja2 import Environment, FileSystemLoader @@ -410,18 +411,15 @@ def get_latest_version(): set_config_value("metadata", "last_update_check", int(time.time())) if update_available: - print() - print( - "A new Update for ProtonVPN-CLI (v{0}) ".format('.'.join( - [str(x) for x in latest_version]) - ) - + "is available.\n" - + "Follow the Update instructions on\n" - + "https://github.com/ProtonVPN/linux-cli/blob/master/USAGE.md#updating-protonvpn-cli\n" - + "\n" - + "To see what's new, check out the changelog:\n" - + "https://github.com/ProtonVPN/linux-cli/blob/master/CHANGELOG.md" - ) + print(dedent(""" + A new Update for ProtonVPN-CLI (v{0}) + is available. + Follow the Update instructions on + https://github.com/ProtonVPN/linux-cli/blob/master/USAGE.md#updating-protonvpn-cli + + To see what's new, check out the changelog: + https://github.com/ProtonVPN/linux-cli/blob/master/CHANGELOG.md""".format( + '.'.join([str(x) for x in latest_version])))) def check_init(): From c8afe0dbfa407cae33c2143a36b0694c59770f95 Mon Sep 17 00:00:00 2001 From: Tim Meehan Date: Fri, 29 Jan 2021 23:48:24 -0600 Subject: [PATCH 2/2] Linter doesn't like my indentation. --- protonvpn_cli/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protonvpn_cli/utils.py b/protonvpn_cli/utils.py index 4e14c97..3d5f485 100644 --- a/protonvpn_cli/utils.py +++ b/protonvpn_cli/utils.py @@ -419,7 +419,7 @@ def get_latest_version(): To see what's new, check out the changelog: https://github.com/ProtonVPN/linux-cli/blob/master/CHANGELOG.md""".format( - '.'.join([str(x) for x in latest_version])))) + '.'.join([str(x) for x in latest_version])))) def check_init():