Skip to content

Commit

Permalink
minor fixes to CI + SIS Emulator switcht to PySide2
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Dec 1, 2018
1 parent 2eb97aa commit 62cb2cd
Show file tree
Hide file tree
Showing 20 changed files with 1,174 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -42,7 +42,7 @@ install:
- pip install https://github.com/hydroffice/hyo2_abc/archive/master.zip
- pip install .
# - conda remove --force PyQt Qt sip
# - rm -f $HOME/miniconda/envs/test-environment/qt.conf
- rm -f $HOME/miniconda/envs/test-environment/qt.conf
- conda list --show-channel-urls

script:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -45,7 +45,7 @@ build: off
build_script:
- pip install .
# - conda remove --force PyQt Qt sip
# - del /q %MINICONDA%\envs\test-environment\qt.conf
- del /q %MINICONDA%\envs\test-environment\qt.conf
- conda list --show-channel-urls

test: off
Expand Down
16 changes: 6 additions & 10 deletions examples/sis/ex_sis_process.py
@@ -1,16 +1,16 @@
from hyo2.soundspeed.logging import test_logging

import logging
import time
from multiprocessing import Pipe
from multiprocessing import Pipe, freeze_support

from hyo.sis.lib.process import SisProcess
from hyo2.sis.lib.process import SisProcess

logger = logging.getLogger()

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)

def main():

if __name__ == '__main__':
freeze_support()
logger.debug("sis process")
parent_conn, child_conn = Pipe()
p = SisProcess(conn=child_conn)
Expand All @@ -32,7 +32,3 @@ def main():

logger.debug("alive: %s" % p.is_alive())
logger.debug('%s.exitcode = %s' % (p.name, p.exitcode)) # <0: killed with signal; >0: exited with error


if __name__ == "__main__":
main()
27 changes: 22 additions & 5 deletions freeze/SIS.py
Expand Up @@ -2,25 +2,42 @@
import sys
from multiprocessing import freeze_support

from PySide import QtGui
from PySide2 import QtWidgets

from hyo2.sis.gui.mainwin import MainWin


class DebugFilter(logging.Filter):

def filter(self, record):

if record.name[:3] != "hyo":
return False

# if (record.name == 'hyo2.soundspeed.listener.sis.sis') and \
# (record.funcName == "parse") and (record.levelname == "INFO"):
# return False

return True


# logging settings
logger = logging.getLogger()
logger.setLevel(logging.NOTSET)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG) # change to WARNING to reduce verbosity, DEBUG for high verbosity
ch_formatter = logging.Formatter('%(levelname)-9s %(name)s.%(funcName)s:%(lineno)d > %(message)s')
ch.setFormatter(ch_formatter)
ch.addFilter(DebugFilter())
logger.addHandler(ch)

from hyo.sis.gui import mainwin


def sis_gui():
"""create the main windows and the event loop"""

app = QtGui.QApplication(sys.argv)
app = QtWidgets.QApplication(sys.argv)

main = mainwin.MainWin()
main = MainWin()
main.show()

sys.exit(app.exec_())
Expand Down
4 changes: 2 additions & 2 deletions freeze/SIS.spec
@@ -1,7 +1,7 @@
from PyInstaller.building.build_main import Analysis, PYZ, EXE, COLLECT, BUNDLE, TOC
from PyInstaller import is_darwin

from hyo.sis import __version__ as sis_version
from hyo2.sis import __version__ as sis_version


def collect_pkg_data(package, include_py_files=False, subdir=None):
Expand All @@ -28,7 +28,7 @@ def collect_pkg_data(package, include_py_files=False, subdir=None):

return data_toc

pkg_data = collect_pkg_data('hyo.sis')
pkg_data = collect_pkg_data('hyo2.sis')

icon_file = 'freeze\SIS.ico'
if is_darwin:
Expand Down
6 changes: 3 additions & 3 deletions freeze/SoundSpeedManager.py
Expand Up @@ -9,9 +9,9 @@ def filter(self, record):
if record.name[:3] != "hyo":
return False

# if (record.name == 'hyo2.soundspeed.listener.sis.sis') and \
# (record.funcName == "parse") and (record.levelname == "INFO"):
# return False
if (record.name == 'hyo2.soundspeed.listener.sis.sis') and \
(record.funcName == "parse") and (record.levelname == "INFO"):
return False

return True

Expand Down
15 changes: 15 additions & 0 deletions hyo2/sis/__init__.py
@@ -0,0 +1,15 @@
"""
Hydro-Package
SIS
"""

import logging
log = logging.getLogger(__name__)
log.addHandler(logging.NullHandler())

name = "SIS"
__version__ = '0.4.0'
__author__ = 'gmasetti@ccom.unh.edu'
__license__ = 'LGPLv3 license'
__copyright__ = 'Copyright 2019 University of New Hampshire, Center for Coastal and Ocean Mapping'

30 changes: 30 additions & 0 deletions hyo2/sis/__main__.py
@@ -0,0 +1,30 @@
import logging
import sys
from multiprocessing import freeze_support

from PySide import QtGui

logger = logging.getLogger()
logger.setLevel(logging.NOTSET)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG) # change to WARNING to reduce verbosity, DEBUG for high verbosity
ch_formatter = logging.Formatter('%(levelname)-9s %(name)s.%(funcName)s:%(lineno)d > %(message)s')
ch.setFormatter(ch_formatter)
logger.addHandler(ch)

from hyo2.sis.gui import mainwin


def sis_gui():
"""create the main windows and the event loop"""

app = QtWidgets.QApplication(sys.argv)

main = mainwin.MainWin()
main.show()

sys.exit(app.exec_())

if __name__ == '__main__':
freeze_support()
sis_gui()
Empty file added hyo2/sis/gui/__init__.py
Empty file.

0 comments on commit 62cb2cd

Please sign in to comment.