Skip to content

Commit

Permalink
Fix style errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LyzardKing committed Nov 3, 2022
1 parent 48de0a7 commit d32e03d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion tests/medium/test_electronics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 1 addition & 2 deletions umake/frameworks/electronics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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)

15 changes: 8 additions & 7 deletions umake/frameworks/ide.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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-*",
Expand Down
8 changes: 4 additions & 4 deletions umake/frameworks/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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)))

2 changes: 0 additions & 2 deletions umake/frameworks/scala.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions umake/network/requirements_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,17 @@ 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
installed_version = re.search(r"version \"([\d\.]+).*\"", self.jre_installed_version).group(1)
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
Expand Down

0 comments on commit d32e03d

Please sign in to comment.