Skip to content

Commit

Permalink
fixed main for NOAA Support app
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Apr 27, 2024
1 parent 67d5e23 commit 8c7706a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
13 changes: 13 additions & 0 deletions hyo2/abc2/app/noaa_support/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
from hyo2.abc2 import pkg_info

app_path = os.path.abspath(os.path.dirname(__file__))
app_media_path = os.path.join(app_path, "media")

app_info = pkg_info.app_info(
app_path=app_path,
app_media_path=app_media_path,
app_icon_path=os.path.join(app_media_path, "noaa_support.png"),
app_tabs_icon_size=36,
app_toolbars_icon_size=28
)
9 changes: 4 additions & 5 deletions hyo2/abc2/app/noaa_support/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from PySide6 import QtWidgets, QtGui

from hyo2.abc2.app.noaa_support.noaa_s57_dialog import NOAAS57Dialog
from hyo2.abc2.lib.lib_info import LibInfo
from hyo2.abc2.app.app_info import AppInfo
from hyo2.abc2.app.app_style import AppStyle
from hyo2.abc2.app.noaa_support import app_info
from hyo2.abc2.app.app_style.app_style import AppStyle

logger = logging.getLogger()

Expand All @@ -28,8 +27,8 @@ def set_logging(default_logging=logging.WARNING, hyo2_logging=logging.INFO, abc_
app.setOrganizationDomain("hydroffice.org")
AppStyle.apply(app=app)

d = NOAAS57Dialog(lib_info=LibInfo(), app_info=AppInfo())
d.setWindowIcon(QtGui.QIcon(os.path.join(AppInfo().app_media_path, "noaa_support.png")))
d = NOAAS57Dialog(app_info=app_info)
d.setWindowIcon(QtGui.QIcon(app_info.app_icon_path))
d.show()

sys.exit(app.exec())
2 changes: 0 additions & 2 deletions hyo2/abc2/app/noaa_support/noaa_support.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import ctypes
import os
import shutil
import traceback
import zipfile
import logging

from hyo2.abc2.lib.progress.cli_progress import CliProgress
from hyo2.abc2.lib.package.pkg_info import PkgInfo
from hyo2.abc2.lib.package.pkg_helper import PkgHelper
from hyo2.abc2.lib.ftp import Ftp

logger = logging.getLogger(__name__)

Expand Down
7 changes: 5 additions & 2 deletions tests/app/pkg_info/test_pkg_about_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_with_all_tabs(self):


class TestAppPkgAboutDialogGeneralInfoTab(unittest.TestCase):

@unittest.skipIf(sys.platform == "linux", "Skip PySide6 on Linux")
def test_visibility(self):
if not QtWidgets.QApplication.instance():
QtWidgets.QApplication([])
Expand All @@ -45,6 +45,7 @@ def test_visibility(self):

class TestAppPkgAboutDialogLicenseTab(unittest.TestCase):

@unittest.skipIf(sys.platform == "linux", "Skip PySide6 on Linux")
def test_visibility(self):
if not QtWidgets.QApplication.instance():
QtWidgets.QApplication([])
Expand All @@ -55,6 +56,7 @@ def test_visibility(self):

class TestAppPkgAboutDialogLocalEnvironmentTab(unittest.TestCase):

@unittest.skipIf(sys.platform == "linux", "Skip PySide6 on Linux")
def test_visibility(self):
if not QtWidgets.QApplication.instance():
QtWidgets.QApplication([])
Expand All @@ -64,7 +66,8 @@ def test_visibility(self):


class TestAppPkgAboutDialogGdalInfoTab(unittest.TestCase):


@unittest.skipIf(sys.platform == "linux", "Skip PySide6 on Linux")
def test_visibility(self):
if not QtWidgets.QApplication.instance():
QtWidgets.QApplication([])
Expand Down

0 comments on commit 8c7706a

Please sign in to comment.