diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..08639b6e7 --- /dev/null +++ b/.flake8 @@ -0,0 +1,34 @@ +[flake8] +exclude = __init__.py, rogue_plugin.py +############################################################# +# Note: Command to remove white space at the end of lines +# $ find . -type f -name "*.py" -print0 | xargs -0 sed -i 's/\s*$//g' +############################################################# +# E116 unexpected indentation (comment) +# E128 continuation line under-indented for visual indent +# E131 continuation line unaligned for hanging indent +# E201 whitespace after '(' +# E202 whitespace before ')' +# E203 whitespace before ':' +# E211 whitespace before '(' +# E221 multiple spaces before operator +# E222 multiple spaces after operator +# E225 missing whitespace around operator +# E226 missing whitespace around arithmetic operator +# E227 missing whitespace around bitwise or shift operator +# E228 missing whitespace around modulo operator +# E231 missing whitespace after ',' +# E241 multiple spaces after ',' +# E251 unexpected spaces around keyword / parameter equals +# E261 at least two spaces before inline comment +# E262 inline comment should start with '# ' +# E265 block comment should start with '# ' +# E266 too many leading '#' for block comment +# E272 multiple spaces before keyword +# E302 expected 2 blank lines, found 1 +# E303 too many blank lines +# E305 expected 2 blank lines after class or function definition +# E306 expected 1 blank line before a nested definition, found 0 +# E501 line too long +############################################################# +ignore = E116,E128,E131,E201,E202,E203,E211,E221,E222,E225,E226,E227,E228,E231,E241,E251,E261,E262,E265,E266,E272,E302,E303,E305,E306,E501 diff --git a/.github/workflows/rogue_ci.yml b/.github/workflows/rogue_ci.yml new file mode 100644 index 000000000..8815eb110 --- /dev/null +++ b/.github/workflows/rogue_ci.yml @@ -0,0 +1,299 @@ +# ---------------------------------------------------------------------------- +# Title : ROGUE GitHub Actions Script +# ---------------------------------------------------------------------------- +# This file is part of the rogue software package. It is subject to +# the license terms in the LICENSE.txt file found in the top-level directory +# of this distribution and at: +# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. +# No part of the rogue software package, including this file, may be +# copied, modified, propagated, or distributed except according to the terms +# contained in the LICENSE.txt file. +# ---------------------------------------------------------------------------- +# The following environment variables are required for this process: +# secrets.GH_TOKEN +# secrets.CONDA_UPLOAD_TOKEN_DEV +# secrets.CONDA_UPLOAD_TOKEN_TAG +# secrets.DOCKERHUB_TOKEN + +name: Rogue Integration +on: [push] + +jobs: + full_build_test: + name: Full Build Test + runs-on: ubuntu-latest + steps: + + # This step checks out a copy of your repository. + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Setup Environment + run: | + EPICS_BASE=${HOME}/packages/epics/base-7.0.3 + EPICS_PCAS_ROOT=${HOME}/packages/pcas/pcas-4.13.2 + LD_LIBRARY_PATH=/usr/lib:${EPICS_BASE}/lib/linux-x86_64:${EPICS_PCAS_ROOT}/lib/linux-x86_64 + echo "EPICS_BASE=$EPICS_BASE" >> $GITHUB_ENV + echo "EPICS_PCAS_ROOT=$EPICS_PCAS_ROOT" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install doxygen doxygen-doc libzmq3-dev libboost-all-dev + python -m pip install --upgrade pip + pip install setuptools + pip install -r pip_requirements.txt + pip install codecov coverage pytest-cov flake8 + + - name: Install EPICS Base + run: | + mkdir -p ${EPICS_BASE} + cd ${EPICS_BASE} + pwd + wget -O base-7.0.3.tar.gz https://github.com/epics-base/epics-base/archive/R7.0.3.tar.gz + tar xzf base-7.0.3.tar.gz --strip 1 + make clean && make && make install + + - name: Install EPICS PCAS + run: | + mkdir -p ${EPICS_PCAS_ROOT} + cd ${EPICS_PCAS_ROOT} + wget -O pcas-4.13.2.tar.gz https://github.com/epics-modules/pcas/archive/v4.13.2.tar.gz + tar xzf pcas-4.13.2.tar.gz --strip 1 + echo "EPICS_BASE=$EPICS_BASE" >> configure/RELEASE.local + make clean && make && make install + + # Rogue + - name: Build Rogue + run: | + python -c "import numpy; print(numpy.get_include())" + mkdir build; cd build + cmake .. -DROGUE_INSTALL=local + make -j4 install + + # Run Tests + - name: Rogue Tests + run: | + source setup_rogue.sh + python -m pytest --cov + + # Flake 8 check + - name: Flake8 Tests + run: | + source setup_rogue.sh + python -m compileall -f ./python/ + #flake8 --count ./python/ + + # Code Coverage + - name: Code Coverage + run: | + source setup_rogue.sh + codecov + coverage report -m + + # Generate Documentation + - name: Generate Documentation + if: github.ref == 'refs/heads/documentation' + run: | + source setup_rogue.sh + cd docs + make html + + - name: Deploy Documentation + if: github.ref == 'refs/heads/documentation' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GH_TOKEN }} + publish_dir: docs/build/html + + small_build_test: + name: Small Build Test + runs-on: ubuntu-latest + steps: + + # This step checks out a copy of your repository. + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install libzmq3-dev + + # Rogue + - name: Build Rogue + run: | + mkdir build; cd build + cmake .. -DROGUE_INSTALL=local -DNO_PYTHON=1 -DSTATIC_LIB=1 + make -j4 install + + gen_release: + name: Generate Release + runs-on: ubuntu-latest + needs: [full_build_test, small_build_test] + if: startsWith(github.ref, 'refs/tags/') + steps: + + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Get Image Information + id: get_image_info + run: | + echo ::set-output name=tag::`git describe --tags` + + - name: Get Ruckus + run: | + git clone https://github.com/slaclab/ruckus.git + python -m pip install --upgrade pip + pip install -r ruckus/scripts/pip_requirements.txt + + - name: Gen Release + env: + TRAVIS_REPO_SLUG: ${{ github.repository }} + TRAVIS_TAG: ${{ steps.get_image_info.outputs.tag }} + GH_REPO_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + python ruckus/scripts/releaseGen.py + + conda_build: + name: Anaconda Build + needs: [full_build_test, small_build_test] + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/pre-release' + strategy: + matrix: + os: + - ubuntu-latest + - macos-10.15 + runs-on: ${{ matrix.os }} + steps: + + # This step checks out a copy of your repository. + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Setup anaconda + env: + OS_NAME: ${{ matrix.os }} + run: | + cd ${HOME} + if [ $OS_NAME == "macos-10.15" ] + then + wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh + else + wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + fi + bash miniconda.sh -b -p ${HOME}/miniconda + export PATH="${HOME}/miniconda/bin:$PATH" + source ${HOME}/miniconda/etc/profile.d/conda.sh + conda config --set always_yes yes + conda install conda-build anaconda-client conda-verify + if [ $OS_NAME == "macos-10.15" ] + then + conda install libiconv libarchive -c conda-forge + fi + conda update -q conda conda-build + conda update --all + + - name: Setup MacOS + if: matrix.os == 'macos-10.15' + run: | + cd ${HOME} + wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz + tar xzf MacOSX10.15.sdk.tar.xz + sudo mkdir -p /opt/ + sudo mv MacOSX10.15.sdk /opt/ + CONDA_BUILD_SYSROOT=/opt/MacOSX10.15.sdk + CONDA_BUILD=1 + echo "CONDA_BUILD_SYSROOT=$CONDA_BUILD_SYSROOT" >> $GITHUB_ENV + echo "CONDA_BUILD=$CONDA_BUILD" >> $GITHUB_ENV + + - name: Get Image Information + id: get_image_info + env: + CONDA_UPLOAD_TOKEN_DEV: ${{ secrets.CONDA_UPLOAD_TOKEN_DEV }} + CONDA_UPLOAD_TOKEN_TAG: ${{ secrets.CONDA_UPLOAD_TOKEN_TAG }} + OS_NAME: ${{ matrix.os }} + run: | + if [ ${GITHUB_REF} == "refs/heads/pre-release" ] + then + echo ::set-output name=token::$CONDA_UPLOAD_TOKEN_DEV + else + echo ::set-output name=token::$CONDA_UPLOAD_TOKEN_TAG + fi + if [ ${OS_NAME} == "macos-10.15" ] + then + echo ::set-output name=os::osx-64 + else + echo ::set-output name=os::linux-64 + fi + + - name: Build And Upload + run: | + export PATH="${HOME}/miniconda/bin:$PATH" + source ${HOME}/miniconda/etc/profile.d/conda.sh + conda build conda-recipe --debug --output-folder bld-dir -c tidair-packages -c conda-forge + anaconda -t ${{ steps.get_image_info.outputs.token }} upload --force bld-dir/${{ steps.get_image_info.outputs.os }}/*.tar.bz2 + + docker_build: + name: Docker Build + runs-on: ubuntu-latest + needs: [full_build_test, small_build_test] + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/pre-release' + steps: + + # This step checks out a copy of your repository. + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Get Image Information + id: get_image_info + run: | + echo ::set-output name=tag::`git describe --tags` + echo ::set-output name=branch::`echo ${GITHUB_REF} | awk 'BEGIN { FS = "/" } ; { print $3 }'` + if [ ${GITHUB_REF} == "refs/heads/pre-release" ] + then + echo ::set-output name=name::"rogue-dev" + else + echo ::set-output name=name::"rogue" + fi + + # Setup docker build environment + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + # Login to Dockerhub + - name: Login to Dockerhub + uses: docker/login-action@v1 + with: + username: tidair + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Build and push the docker image + - name: Build and push image to Dockerhub + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: tidair/${{ steps.get_image_info.outputs.name }}:${{ steps.get_image_info.outputs.tag }} + build-args: branch=${{ steps.get_image_info.outputs.branch }} + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4b9a742b0..000000000 --- a/.travis.yml +++ /dev/null @@ -1,221 +0,0 @@ -dist: xenial -sudo: required - -branches: - except: - - gh-pages - -addons: - apt: - packages: - - doxygen - - doxygen-doc - - python-dev - -services: - - docker - -language: - - python - -python: - - 3.6 - -stages: - - test - - name: gen_release - if: tag IS present - - name: deploy_doc - if: tag IS present - - name: deploy_dev - if: branch = pre-release AND tag IS blank AND NOT (type = pull_request) - - name: deploy_tag - if: tag IS present - -env: - global: - - PY_PATH=$HOME/virtualenv/python3.6.7 - - PACKAGE_DIR=$HOME/packages - - BOOST_DIR=$PACKAGE_DIR/boost_1_64_0 - - EPICS_DIR=$PACKAGE_DIR/epics/base-7.0.3 - - EPICS_PCAS_DIR=$PACKAGE_DIR/pcas/pcas-4.13.2 - - MINICONDA_DIR=$PACKAGE_DIR/miniconda - - DOCKER_ORG_NAME=tidair - - GITHUB_REPO=slaclab/rogue - -jobs: - include: - # Test stage - - stage: test - name: "Unit Tests" - before_install: - # Prepare enviroment - - export CPLUS_INCLUDE_PATH=$PY_PATH/include/python3.6m - - export LD_LIBRARY_PATH=$BOOST_DIR/stage/lib:$PY_PATH/lib:$LD_LIBRARY_PATH - - export BOOST_ROOT=$BOOST_DIR - - export EPICS_BASE=$EPICS_DIR - - export EPICS_CA_ADDR_LIST=127.0.0.1 - - export EPICS_PCAS_ROOT=$EPICS_PCAS_DIR - # Install zeromq - - sudo apt-get install -qq libzmq3-dev - # Prepare folders - - mkdir -p $BOOST_DIR - - mkdir -p $EPICS_DIR - - mkdir -p $EPICS_PCAS_DIR - # Bring all the tags - - git pull --unshallow - - git pull - - install: - # Tools - - pip install -r pip_requirements.txt - - # Boost - - cd $BOOST_DIR - - wget -O boost_1_64_0.tar.gz http://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.gz/download - - tar xzf boost_1_64_0.tar.gz --strip 1 - - ./bootstrap.sh --with-libraries=system,thread,python - - travis_wait ./b2 link=shared threading=multi variant=release -d0 - - # EPICS base - - cd $EPICS_DIR - - wget -O base-7.0.3.tar.gz https://github.com/epics-base/epics-base/archive/R7.0.3.tar.gz - - tar xzf base-7.0.3.tar.gz --strip 1 - - make clean && make && make install - - # EPICS pcas - - cd $EPICS_PCAS_DIR - - wget -O pcas-4.13.2.tar.gz https://github.com/epics-modules/pcas/archive/v4.13.2.tar.gz - - tar xzf pcas-4.13.2.tar.gz --strip 1 - - echo "EPICS_BASE=$EPICS_BASE" >> configure/RELEASE.local - - make clean && make && make install - - # Rogue - - cd $TRAVIS_BUILD_DIR - - mkdir build; cd build - - cmake .. -DROGUE_INSTALL=local -DPYTHON_LIBRARY=$PY_PATH/lib/python3.6 -DPYTHON_INCLUDE_DIR=$PY_PATH/include - - make -j4 install - - # Build Docs - - if [ "$TRAVIS_BRANCH" = "documentation" ]; then - cd $TRAVIS_BUILD_DIR; - source setup_rogue.sh; - cd docs; - make html; - fi - - before_script: - # Prepare rogue enviroment - - cd $TRAVIS_BUILD_DIR - - source setup_rogue.sh - - script: - # Run tests with coverage - - cd $TRAVIS_BUILD_DIR - - python3 -m pytest - - after_success: - # Publish docs. - - if [ "$TRAVIS_BRANCH" = "documentation" ]; then - doctr deploy . --built-docs docs/build/html --deploy-branch-name gh-pages --branch-whitelist documentation; - fi - - - stage: gen_release - name: "Generate Release" - install: - - git clone https://github.com/slaclab/ruckus.git - - pip install -r ruckus/scripts/pip_requirements.txt - script: - - python ruckus/scripts/releaseGen.py - - # Deploy development version stage (deploy_dev) - - &deploy-docker-stage # Docker - stage: deploy_dev - name: "Deploy Docker" - env: DOCKER_REPO=rogue-dev - before_install: - # Prepare enviroment - - export DOCKER_TAG=`git describe --tags` - - export DOCKER_IMAGE_NAME=$DOCKER_ORG_NAME/$DOCKER_REPO - # Bring all the tags - - git pull --unshallow - - git pull - - before_script: - # Login to docker - - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; - - script: - # Build docker image - - travis_wait docker build -q --build-arg branch=$TRAVIS_BRANCH -t $DOCKER_IMAGE_NAME .; - - after_success: - # Upload docker image (as tagged and latest version) - - docker push $DOCKER_IMAGE_NAME; - - docker tag $DOCKER_IMAGE_NAME $DOCKER_IMAGE_NAME:$DOCKER_TAG; - - docker push $DOCKER_IMAGE_NAME:$DOCKER_TAG; - - - &deploy-conda-stage # Conda for linux - stage: deploy_dev - name: "Deploy Conda" - env: CONDA_TOKEN=$CONDA_UPLOAD_TOKEN_DEV - before_install: - # Prepare folders - - mkdir -p $MINICONDA_DIR - # Bring all the tags - - git pull --unshallow - - git pull - # on OSX rogue needs an older version of the MacOS SDK - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - git clone https://github.com/phracker/MacOSX-SDKs; - sudo mv MacOSX-SDKs/MacOSX10.9.sdk /opt/; - export CONDA_BUILD_SYSROOT=/opt/MacOSX10.9.sdk; - export CONDA_BUILD=1; - fi - - install: - # Install Anaconda for the right architecture (linux or osx) - - cd $MINICONDA_DIR - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh; - else - wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh; - fi - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes - - conda install conda-build anaconda-client conda-verify - - conda update -q conda conda-build - - before_script: - # Go back to top directory - - cd $TRAVIS_BUILD_DIR - - script: - # Build conda package - - travis_wait 120 conda build --debug conda-recipe --output-folder bld-dir -c tidair-packages -c pydm-tag -c conda-forge - - after_success: - # Upload conda package - - anaconda -t $CONDA_TOKEN upload bld-dir/`echo $TRAVIS_OS_NAME`-64/*.tar.bz2 - - #- <<: *deploy-conda-stage # Conda for MacOS - #os: osx - #language: ruby # osx does not support language=python - - # Deploy tagged version stage (deploy_tag) - - <<: *deploy-docker-stage # Docker - stage: deploy_tag - env: DOCKER_REPO=rogue - - - <<: *deploy-conda-stage # Conda for Linux - stage: deploy_tag - env: CONDA_TOKEN=$CONDA_UPLOAD_TOKEN_TAG - - # - <<: *deploy-conda-stage # Conda for macOS - #stage: deploy_tag - #os: osx - #language: ruby # osx does not support language=python - #env: CONDA_TOKEN=$CONDA_UPLOAD_TOKEN_TAG - diff --git a/python/pyrogue/_Root.py b/python/pyrogue/_Root.py index ba94245cd..79168e5cc 100644 --- a/python/pyrogue/_Root.py +++ b/python/pyrogue/_Root.py @@ -58,16 +58,14 @@ def emit(self,record): se['traceBack'].append(tb.rstrip()) # System log is a running json encoded list - # Need to remove list terminator ']' and add new entry + list terminator with self._root.SystemLog.lock: - msg = self._root.SystemLog.value()[:-1] + lst = jsonpickle.decode(self._root.SystemLog.value()) - # Only add a comma and return if list is not empty - if len(msg) > 1: - msg += ',\n' + # Limit system log size + lst = lst[-1 * (self._root._maxLog-1):] - msg += jsonpickle.encode(se) + ']' - self._root.SystemLog.set(msg) + lst.append(se) + self._root.SystemLog.set(jsonpickle.encode(lst)) # Log to database if self._root._sqlLog is not None: @@ -119,6 +117,7 @@ def __init__(self, *, pollEn=True, serverPort=0, # 9099 is the default, 0 for auto sqlUrl=None, + maxLog=1000, streamIncGroups=None, streamExcGroups=['NoStream'], sqlIncGroups=None, @@ -133,6 +132,7 @@ def __init__(self, *, self._pollEn = pollEn self._serverPort = serverPort self._sqlUrl = sqlUrl + self._maxLog = maxLog self._streamIncGroups = streamIncGroups self._streamExcGroups = streamExcGroups self._sqlIncGroups = sqlIncGroups diff --git a/python/pyrogue/pydm/widgets/system_log.py b/python/pyrogue/pydm/widgets/system_log.py index 6bf76a48f..d1b0db501 100644 --- a/python/pyrogue/pydm/widgets/system_log.py +++ b/python/pyrogue/pydm/widgets/system_log.py @@ -1,12 +1,12 @@ #----------------------------------------------------------------------------- # Title : PyRogue PyDM System Log Widget #----------------------------------------------------------------------------- -# This file is part of the rogue software platform. It is subject to -# the license terms in the LICENSE.txt file found in the top-level directory -# of this distribution and at: -# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. -# No part of the rogue software platform, including this file, may be -# copied, modified, propagated, or distributed except according to the terms +# This file is part of the rogue software platform. It is subject to +# the license terms in the LICENSE.txt file found in the top-level directory +# of this distribution and at: +# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. +# No part of the rogue software platform, including this file, may be +# copied, modified, propagated, or distributed except according to the terms # contained in the LICENSE.txt file. #----------------------------------------------------------------------------- @@ -24,7 +24,6 @@ def __init__(self, parent=None, init_channel=None): PyDMFrame.__init__(self, parent, init_channel) self._systemLog = None - self._logCount = 0 self._node = None def connection_changed(self, connected): @@ -39,7 +38,7 @@ def connection_changed(self, connected): vb = QVBoxLayout() self.setLayout(vb) - gb = QGroupBox('System Log') + gb = QGroupBox('System Log (20 most recent entries)') vb.addWidget(gb) vb = QVBoxLayout() @@ -52,47 +51,45 @@ def connection_changed(self, connected): self._systemLog.setHeaderLabels(['Field','Value']) self._systemLog.setColumnWidth(0,200) - self._logCount = 0 - self._pb = PyDMPushButton(label='Clear Log',pressValue=1,init_channel=self._path) vb.addWidget(self._pb) def value_changed(self, new_val): lst = jsonpickle.decode(new_val) - if len(lst) == 0: - self._systemLog.clear() - - elif len(lst) > self._logCount: - for i in range(self._logCount,len(lst)): - widget = QTreeWidgetItem(self._systemLog) - widget.setText(0, time.strftime("%Y-%m-%d %H:%M:%S %Z", time.localtime(lst[i]['created']))) - - widget.setText(1,lst[i]['message']) - widget.setExpanded(False) - widget.setTextAlignment(0,Qt.AlignTop) - - temp = QTreeWidgetItem(widget) - temp.setText(0,'Name') - temp.setText(1,str(lst[i]['name'])) - temp.setTextAlignment(0,Qt.AlignRight) - - temp = QTreeWidgetItem(widget) - temp.setText(0,'Level') - temp.setText(1,'{} ({})'.format(lst[i]['levelName'],lst[i]['levelNumber'])) - temp.setTextAlignment(0,Qt.AlignRight) - - if lst[i]['exception'] is not None: - exc = QTreeWidgetItem(widget) - exc.setText(0,'exception') - exc.setText(1,str(lst[i]['exception'])) - exc.setExpanded(False) - exc.setTextAlignment(0,Qt.AlignRight) - - for v in lst[i]['traceBack']: - temp = QTreeWidgetItem(exc) - temp.setText(0,'') - temp.setText(1,v) - - self._logCount = len(lst) + self._systemLog.clear() + + # Show only the last 20 entries + # In the future we can consider a pop up dialog with the full log. + # Unclear if that is neccessary. + for ent in lst[-20:]: + widget = QTreeWidgetItem(self._systemLog) + widget.setText(0, time.strftime("%Y-%m-%d %H:%M:%S %Z", time.localtime(ent['created']))) + + widget.setText(1,ent['message']) + widget.setExpanded(False) + widget.setTextAlignment(0,Qt.AlignTop) + + temp = QTreeWidgetItem(widget) + temp.setText(0,'Name') + temp.setText(1,str(ent['name'])) + temp.setTextAlignment(0,Qt.AlignRight) + + temp = QTreeWidgetItem(widget) + temp.setText(0,'Level') + temp.setText(1,'{} ({})'.format(ent['levelName'],ent['levelNumber'])) + temp.setTextAlignment(0,Qt.AlignRight) + + if ent['exception'] is not None: + exc = QTreeWidgetItem(widget) + exc.setText(0,'exception') + exc.setText(1,str(ent['exception'])) + exc.setExpanded(False) + exc.setTextAlignment(0,Qt.AlignRight) + + for v in ent['traceBack']: + temp = QTreeWidgetItem(exc) + temp.setText(0,'') + temp.setText(1,v) + diff --git a/src/rogue/interfaces/ZmqServer.cpp b/src/rogue/interfaces/ZmqServer.cpp index eaaec8e28..aa9e02d7d 100755 --- a/src/rogue/interfaces/ZmqServer.cpp +++ b/src/rogue/interfaces/ZmqServer.cpp @@ -202,7 +202,10 @@ bp::object rogue::interfaces::ZmqServerWrap::defDoRequest ( bp::object data ) { void rogue::interfaces::ZmqServer::runThread() { zmq_msg_t rxMsg; zmq_msg_t txMsg; + +#ifndef NO_PYTHON Py_buffer valueBuf; +#endif log_->logThreadId(); log_->info("Started Rogue server thread"); diff --git a/tests/test_server.py b/tests/test_server.py index 9447e21c7..307d2eee4 100755 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -46,6 +46,7 @@ def __init__(self): timeout=2.0, pollEn=True, serverPort=0, + #maxLog=10, #sqlUrl='sqlite:///test.db') )