def test_init(self): # noinspection PyArgumentList if not QtWidgets.QApplication.instance(): QtWidgets.QApplication([]) li = LibInfo() rep = Report(lib_name=li.lib_name, lib_version=li.lib_version) rep += "Test [CHECK]" rep += "OK" rep += "Test [CHECK]" rep += "test" rep += "test" rep += "test" rep += "test [SKIP_CHK]" rep += "skip [SKIP_REP]" rep += "End [TOTAL]" rep += "Check 1 - Test" rep += "Check 2 - Test" rep.display() rep.generate_pdf(path=str( self.testing.output_data_folder().joinpath('test.pdf')), title="Test Document", use_colors=True, small=True)
def test_visibility(self): if not QtWidgets.QApplication.instance(): QtWidgets.QApplication([]) d = ExceptionDialog(lib_info=LibInfo(), app_info=AppInfo()) d.show()
def test_visibility(self): if not qApp: QApplication([]) d = ExceptionDialog(lib_info=LibInfo(), app_info=AppInfo()) d.show()
def test_visibility(self): if not QtWidgets.qApp: QtWidgets.QApplication([]) t = GeneralInfoTab(lib_info=LibInfo()) t.show()
def test_init(self): noaa_support = NOAASupport(lib_info=LibInfo(), app_info=AppInfo()) self.assertTrue("v" in noaa_support.v_version()) self.assertTrue(os.path.exists(noaa_support.internal_zip_path())) self.assertTrue(noaa_support.internal_zip_path_exists())
def test_visibility(self): if not QtWidgets.qApp: QtWidgets.QApplication([]) d = NOAAS57Dialog(lib_info=LibInfo(), app_info=AppInfo()) d.show()
def test_with_all_tabs(self): if not QtWidgets.qApp: QtWidgets.QApplication([]) d = AboutDialog(lib_info=LibInfo(), app_info=AppInfo(), with_gdal_tab=True, with_locale_tab=True) d.show()
def test_visibility(self): if not QtWidgets.qApp: QtWidgets.QApplication([]) d = AboutDialog(lib_info=LibInfo(), app_info=AppInfo()) d.show() d.switch_visible() d.switch_visible()
def test_show(self): if not QtWidgets.QApplication.instance(): QtWidgets.QApplication([]) mw = QtWidgets.QMainWindow() t = InfoTab(main_win=mw, lib_info=LibInfo(), app_info=AppInfo(), with_online_manual=True, with_offline_manual=True, with_bug_report=True, with_hydroffice_link=True, with_ccom_link=True, with_noaa_link=True, with_unh_link=True, with_license=True) t.show()
import os from hyo2.abc.lib.lib_info import LibInfo from hyo2.openbst import name from hyo2.openbst import __version__ lib_info = LibInfo() lib_info.lib_name = name lib_info.lib_version = __version__ lib_info.lib_author = "G.Masetti (CCOM/JHC); Jean-Marie Augustin (IFREMER); Cyrille Poncelet (IFREMER)" lib_info.lib_author_email = "[email protected]; [email protected]; [email protected]" lib_info.lib_license = "LGPL v3" lib_info.lib_license_url = "https://www.hydroffice.org/license/" lib_info.lib_path = os.path.abspath(os.path.dirname(__file__)) lib_info.lib_url = "https://www.hydroffice.org/openbst/" lib_info.lib_manual_url = "https://www.hydroffice.org/manuals/openbst/index.html" lib_info.lib_support_email = "*****@*****.**" lib_info.lib_latest_url = "https://www.hydroffice.org/latest/openbst.txt" lib_info.lib_dep_dict = { "hyo2.abc": "hyo2.abc", "gdal": "osgeo", "numpy": "numpy", "scipy": "scipy", "pyproj": "pyproj", "h5py": "h5py", "netCDF4": "netCDF4", "PySide2": "PySide2",
def setUp(self): self.h = Helper(lib_info=LibInfo())
import sys import logging from PySide2 import QtWidgets from hyo2.abc.app.report import Report from hyo2.abc.lib.lib_info import LibInfo from hyo2.abc.lib.logging import set_logging logger = logging.getLogger(__name__) set_logging(ns_list=["hyo2.abc"]) app = QtWidgets.QApplication([]) li = LibInfo() r = Report(lib_name=li.lib_name, lib_version=li.lib_version) # sys.exit(app.exec_())
Sound Speed """ import os import logging from hyo2.abc.lib.lib_info import LibInfo logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) name = "Sound Speed" __version__ = '2021.2.4' __copyright__ = 'Copyright 2021 University of New Hampshire, Center for Coastal and Ocean Mapping' lib_info = LibInfo() lib_info.lib_name = name lib_info.lib_version = __version__ lib_info.lib_author = "Giuseppe Masetti(UNH,CCOM); Barry Gallagher(NOAA,OCS); " \ "Chen Zhang(NOAA,OCS)" lib_info.lib_author_email = "[email protected]; [email protected]; " \ "*****@*****.**" lib_info.lib_license = "LGPLv2.1 or CCOM-UNH Industrial Associate license" lib_info.lib_license_url = "https://www.hydroffice.org/license/" lib_info.lib_path = os.path.abspath(os.path.dirname(__file__)) lib_info.lib_url = "https://www.hydroffice.org/soundspeed/" lib_info.lib_manual_url = "https://www.hydroffice.org/manuals/soundspeed/index.html"
def setUp(self): self.li = LibInfo()
import sys import logging from PySide2 import QtWidgets from hyo2.abc.app.dialogs.about.about_dialog import AboutDialog from hyo2.abc.lib.lib_info import LibInfo from hyo2.abc.app.app_info import AppInfo from hyo2.abc.lib.logging import set_logging logger = logging.getLogger(__name__) set_logging(ns_list=["hyo2.abc"]) app = QtWidgets.QApplication([]) d = AboutDialog(lib_info=LibInfo(), app_info=AppInfo(), with_locale_tab=True, with_gdal_tab=True) d.show() sys.exit(app.exec_())
import sys from PySide2 import QtWidgets, QtGui, QtCore from hyo2.abc.lib.helper import Helper from hyo2.abc.lib.lib_info import LibInfo from hyo2.abc.app.app_style import AppStyle from hyo2.abc.app.app_info import AppInfo from hyo2.abc.app.tabs.info.info_tab import InfoTab from hyo2.abc.lib.logging import set_logging set_logging(ns_list=[ "hyo2.abc", ]) app_info = AppInfo() lib_info = LibInfo() app = QtWidgets.QApplication([]) app.setApplicationName('%s' % app_info.app_name) app.setOrganizationName("HydrOffice") app.setOrganizationDomain("hydroffice.org") app.setStyleSheet(AppStyle.load_stylesheet()) if Helper.is_script_already_running(): txt = "The app is already running!" msg_box = QtWidgets.QMessageBox() msg_box.setWindowTitle("Multiple Instances of ABC") msg_box.setIconPixmap( QtGui.QPixmap(app_info.app_icon_path).scaled(QtCore.QSize(36, 36))) msg_box.setText( '%s\n\nDo you want to continue? This might create issues.' % txt) msg_box.setStandardButtons(QtWidgets.QMessageBox.Yes
""" Hydro-Package SIS4 """ import os from hyo2.abc.lib.lib_info import LibInfo from hyo2.kng.emu.sis4 import name, __version__ import logging log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) lib_info = LibInfo() lib_info.lib_name = name lib_info.lib_version = __version__ lib_info.lib_author = "Giuseppe Masetti(UNH,CCOM)" lib_info.lib_author_email = "*****@*****.**" lib_info.lib_license = "LGPLv3" lib_info.lib_license_url = "https://www.hydroffice.org/license/" lib_info.lib_path = os.path.abspath(os.path.dirname(__file__)) lib_info.lib_url = "https://www.hydroffice.org/kng/" lib_info.lib_manual_url = "https://www.hydroffice.org/manuals/kng/index.html" lib_info.lib_support_email = "*****@*****.**" lib_info.lib_latest_url = "https://www.hydroffice.org/latest/sis4.txt" lib_info.lib_dep_dict = {"hyo2.abc": "hyo2.abc", "PySide2": "PySide2"}
import os from hyo2.abc.lib.lib_info import LibInfo from hyo2.qc import __version__ from hyo2.qc import name lib_info = LibInfo() lib_info.lib_name = name lib_info.lib_version = __version__ lib_info.lib_author = "Giuseppe Masetti(UNH,CCOM); Tyanne Faulkes(NOAA,OCS); Julia Wallace(NOAA,OCS); " \ "Matthew Wilson(NOAA,OCS)" lib_info.lib_author_email = "[email protected]; [email protected]; [email protected]; " \ "*****@*****.**" lib_info.lib_license = "LGPL v3" lib_info.lib_license_url = "https://www.hydroffice.org/license/" lib_info.lib_path = os.path.abspath(os.path.dirname(__file__)) lib_info.lib_url = "https://www.hydroffice.org/qctools/" lib_info.lib_manual_url = "https://www.hydroffice.org/manuals/qctools/stable/index.html" lib_info.lib_support_email = "*****@*****.**" lib_info.lib_latest_url = "https://www.hydroffice.org/latest/qctools.txt" lib_info.lib_dep_dict = { "hyo2.abc": "hyo2.abc", "hyo2.bag": "hyo2.bag", "hyo2.grids": "hyo2.grids", "hyo2.s57": "hyo2.s57", "gdal": "osgeo",
from hyo2.abc.lib.lib_info import LibInfo from hyo2.abc.app.app_info import AppInfo from hyo2.abc.lib.logging import set_logging logger = logging.getLogger(__name__) set_logging(ns_list=["hyo2.abc"]) use_setup = 0 # 0: internal, 1: NOAA, 2: CCOM delete_local_folder = False copy_files = True QtWidgets.QApplication([]) w = QtWidgets.QWidget() w.show() noaa_support = NOAASupport(lib_info=LibInfo(), app_info=AppInfo(), progress=QtProgress(parent=w)) if use_setup == 0: if noaa_support.internal_zip_path_exists(): internal_zip_path = noaa_support.internal_zip_path() logger.debug("internal zip: %s" % internal_zip_path) success = noaa_support.unzip_internal_zip() logger.debug("installed internal zip: %s" % success) if not success: exit(-1) elif use_setup == 1: # 5.8 is now 7z, thus this fails
from hyo2.abc.app.app_style import AppStyle logger = logging.getLogger() def set_logging(default_logging=logging.WARNING, hyo2_logging=logging.INFO, abc_logging=logging.DEBUG): logging.basicConfig( level=default_logging, format="%(levelname)-9s %(name)s.%(funcName)s:%(lineno)d > %(message)s" ) logging.getLogger("hyo2").setLevel(hyo2_logging) logging.getLogger("hyo2.abc").setLevel(abc_logging) set_logging() app = QtWidgets.QApplication([]) app.setApplicationName('NOAA S57') app.setOrganizationName("HydrOffice") app.setOrganizationDomain("hydroffice.org") app.setStyleSheet(AppStyle.load_stylesheet()) d = NOAAS57Dialog(lib_info=LibInfo(), app_info=AppInfo()) d.setWindowIcon( QtGui.QIcon(os.path.join(AppInfo().app_media_path, "noaa_support.png"))) d.show() sys.exit(app.exec_())
def _web_engine_folder(cls) -> str: dir_path = os.path.abspath(os.path.join(Helper(lib_info=LibInfo()).hydroffice_folder(), "WebEngine")) if not os.path.exists(dir_path): # create it if it does not exist os.makedirs(dir_path) return dir_path
import logging from hyo2.abc.lib.helper import Helper from hyo2.abc.lib.lib_info import LibInfo from hyo2.abc.lib.logging import set_logging logger = logging.getLogger(__name__) set_logging(ns_list=["hyo2.abc"]) h = Helper(lib_info=LibInfo()) logger.debug("lib info:\n%s" % h.package_info()) logger.debug("is Pydro: %s" % Helper.is_pydro()) if Helper.is_pydro(): logger.debug("HSTB folder: %s" % Helper.hstb_folder()) logger.debug("atlases folder: %s" % Helper.hstb_atlases_folder()) logger.debug("WOA09 folder: %s" % Helper.hstb_woa09_folder()) logger.debug("WOA13 folder: %s" % Helper.hstb_woa13_folder())
import sys import logging from PySide2 import QtWidgets from hyo2.abc.app.dialogs.exception.exception_dialog import ExceptionDialog from hyo2.abc.lib.lib_info import LibInfo from hyo2.abc.app.app_info import AppInfo from hyo2.abc.lib.logging import set_logging logger = logging.getLogger(__name__) set_logging(ns_list=["hyo2.abc"]) app = QtWidgets.QApplication([]) d = ExceptionDialog(lib_info=LibInfo(), app_info=AppInfo()) d.show() sys.exit(app.exec_())