示例#1
0
    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 QtWidgets.qApp:
            QtWidgets.QApplication([])

        d = NOAAS57Dialog(lib_info=LibInfo(), app_info=AppInfo())
        d.show()
示例#3
0
    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)
示例#4
0
    def test_visibility(self):

        if not qApp:
            QApplication([])

        d = ExceptionDialog(lib_info=LibInfo(), app_info=AppInfo())
        d.show()
示例#5
0
    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())
示例#7
0
    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()
示例#8
0
    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()
示例#9
0
    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()
示例#10
0
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_())
示例#11
0
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
示例#12
0
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_())
示例#13
0
    def setUp(self):

        self.li = LibInfo()
示例#14
0
    def setUp(self):

        self.h = Helper(lib_info=LibInfo())
示例#15
0
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
示例#16
0
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_())
示例#17
0
 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
示例#18
0
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())
示例#19
0
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_())