From d32e03d21abd8d8229fe8922af70aeb36b78f537 Mon Sep 17 00:00:00 2001 From: Galileo Sartor Date: Thu, 3 Nov 2022 08:57:35 +0100 Subject: [PATCH] Fix style errors --- tests/medium/test_electronics.py | 2 +- umake/frameworks/electronics.py | 3 +-- umake/frameworks/ide.py | 15 ++++++++------- umake/frameworks/java.py | 8 ++++---- umake/frameworks/scala.py | 2 -- umake/network/requirements_handler.py | 6 ++++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/medium/test_electronics.py b/tests/medium/test_electronics.py index b79941e0..a6a4ebf2 100644 --- a/tests/medium/test_electronics.py +++ b/tests/medium/test_electronics.py @@ -24,7 +24,7 @@ import os from ..large import test_electronics -from ..tools import get_data_dir, swap_file_and_restore, UMAKE +from ..tools import get_data_dir, UMAKE class ArduinoIDEInContainer(ContainerTests, test_electronics.ArduinoIDETests): diff --git a/umake/frameworks/electronics.py b/umake/frameworks/electronics.py index 944488e9..c6418d33 100644 --- a/umake/frameworks/electronics.py +++ b/umake/frameworks/electronics.py @@ -34,7 +34,7 @@ import umake.frameworks.baseinstaller from umake.interactions import DisplayMessage from umake.tools import as_root, create_launcher, get_application_desktop_file, ChecksumType,\ - MainLoop, get_current_arch, get_current_distro_version + MainLoop, get_current_arch from umake.ui import UI logger = logging.getLogger(__name__) @@ -171,4 +171,3 @@ class Fritzing(umake.frameworks.baseinstaller.BaseInstaller): def __init__(self, **kwargs): super().__init__(name="Fritzing", description="For removal only (tarfile not supported upstream anymore)", download_page=None, only_on_archs=['amd64'], only_for_removal=True, **kwargs) - \ No newline at end of file diff --git a/umake/frameworks/ide.py b/umake/frameworks/ide.py index b034858d..705f14e5 100644 --- a/umake/frameworks/ide.py +++ b/umake/frameworks/ide.py @@ -32,7 +32,7 @@ import umake.frameworks.baseinstaller from umake.network.download_center import DownloadCenter, DownloadItem from umake.tools import create_launcher, get_application_desktop_file, ChecksumType, MainLoop,\ - add_exec_link, get_current_arch, get_current_distro_version + get_current_arch, get_current_distro_version logger = logging.getLogger(__name__) @@ -172,11 +172,11 @@ class EclipseJS(BaseEclipse): executable = 'eclipse' def __init__(self, **kwargs): - super().__init__(name="Eclipse JavaScript", - description="For removal only (tarfile not supported upstream anymore)", - download_page=None, only_on_archs=['i386', 'amd64'], - icon_filename='js.png', - only_for_removal=True, **kwargs) + super().__init__(name="Eclipse JavaScript", + description="For removal only (tarfile not supported upstream anymore)", + download_page=None, only_on_archs=['i386', 'amd64'], + icon_filename='js.png', + only_for_removal=True, **kwargs) class EclipseCPP(BaseEclipse): @@ -836,7 +836,8 @@ def __init__(self, **kwargs): super().__init__(name="RStudio", description=_("RStudio code editor"), only_on_archs=['amd64'], download_page="https://www.rstudio.com/products/rstudio/download/", - # packages_requirements=["libjpeg62", "libedit2", "libssl1.0.0 | libssl1.0.3 | libssl1.1", "libclang-dev", "libpq5", "r-base"], + packages_requirements=["libjpeg62", "libedit2", "libssl1.0.0 | libssl1.0.3 | libssl1.1", + "libclang-dev", "libpq5", "r-base"], desktop_filename="rstudio.desktop", required_files_path=["bin/rstudio"], dir_to_decompress_in_tarball="rstudio-*", diff --git a/umake/frameworks/java.py b/umake/frameworks/java.py index 3f9422e5..0f7e9f2a 100644 --- a/umake/frameworks/java.py +++ b/umake/frameworks/java.py @@ -94,7 +94,8 @@ def complete_download_url(self, result): self.download_page = f"https://api.adoptopenjdk.net/v3/assets/latest/{}/{}".format(version, self.jvm_impl) # Check download page, or revert to previous version if requests.get(self.download_page).json() == []: - self.download_page = f"https://api.adoptopenjdk.net/v3/assets/latest/{}/{}".format(version_prev, self.jvm_impl) + self.download_page = f"https://api.adoptopenjdk.net/v3/assets/latest/{}/{}".format(version_prev, + self.jvm_impl) DownloadCenter([DownloadItem(self.download_page)], self.get_metadata_and_check_license, download=False) def parse_download_link(self, line, in_download): @@ -141,7 +142,6 @@ def __init__(self, **kwargs): description=_("Client application platform for desktop, " + "mobile and embedded systems built on Java"), is_category_default=False, - # download_page="https://gluonhq.com/products/javafx/", download_page="https://api.github.com/repos/openjdk/jfx/contents/doc-files", dir_to_decompress_in_tarball="javafx-*", only_on_archs=['amd64'], checksum_type=ChecksumType.sha256, @@ -158,7 +158,8 @@ def parse_download_link(self, line, in_download): if "release-notes" in item["name"]: version = re.search(r'release-notes-(.*).md', item["name"]).group(1) with suppress(AttributeError): - self.new_download_url = f"https://download2.gluonhq.com/openjfx/{version}/openjfx-{version}_linux-x64_bin-sdk.zip.sha256" + self.new_download_url = \ + f"https://download2.gluonhq.com/openjfx/{version}/openjfx-{version}_linux-x64_bin-sdk.zip.sha256" return (None, in_download) @MainLoop.in_mainloop_thread @@ -172,4 +173,3 @@ def post_install(self): """Add the necessary OpenJFX environment variables""" add_env_to_user(self.name, {"PATH_TO_FX": {"value": os.path.join(self.install_path, "lib"), "keep": False}}) UI.delayed_display(DisplayMessage(self.RELOGIN_REQUIRE_MSG.format(self.name))) - diff --git a/umake/frameworks/scala.py b/umake/frameworks/scala.py index dbc74c0c..4b7a8d41 100644 --- a/umake/frameworks/scala.py +++ b/umake/frameworks/scala.py @@ -21,11 +21,9 @@ """Scala module""" -from contextlib import suppress from gettext import gettext as _ import logging import os -import re import umake.frameworks.baseinstaller from umake.interactions import DisplayMessage from umake.tools import add_env_to_user diff --git a/umake/network/requirements_handler.py b/umake/network/requirements_handler.py index 575b37ea..ad6d9d05 100644 --- a/umake/network/requirements_handler.py +++ b/umake/network/requirements_handler.py @@ -151,7 +151,8 @@ def check_java_equiv(self, pkg_name): if required_release == "jre": if not self.jre_installed_version: try: - self.jre_installed_version = subprocess.check_output(["java", "-version"], stderr=subprocess.STDOUT).decode() + self.jre_installed_version = subprocess.check_output(["java", "-version"], + stderr=subprocess.STDOUT).decode() except FileNotFoundError as e: logger.debug("Missing java command: consider it not installed") return False @@ -159,7 +160,8 @@ def check_java_equiv(self, pkg_name): elif required_release == "jdk": if not self.jdk_installed_version: try: - self.jdk_installed_version = subprocess.check_output(["javac", "-version"], stderr=subprocess.STDOUT).decode() + self.jdk_installed_version = subprocess.check_output(["javac", "-version"], + stderr=subprocess.STDOUT).decode() except FileNotFoundError as e: logger.debug("Missing javac command: consider it not installed") return False