Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • cebash/sakia
  • santiago/sakia
  • jonas/sakia
3 results
Select Git revision
Show changes
Commits on Source (21)
stages:
- github-sync
- build_and_test
- release
variables:
PYENV_PYTHON_VERSION: 3.5.5
image: registry.duniter.org/docker/python3/duniterpy-builder:0.0.7
push_to_github:
stage: github-sync
variables:
GIT_STRATEGY: none
tags:
- github
script:
- rm -rf ./*
- rm -rf .git
- git clone --mirror $CI_REPOSITORY_URL .
- git remote add github $GITHUB_URL_AND_KEY
- git config --global user.email "contact@duniter.org"
- git config --global user.name "Duniter"
# Job would fail if we don't remove refs about pull requests
- bash -c "cat packed-refs | grep -v 'refs/pull' > packed-refs-new; echo 'Removed pull refs.'"
- mv packed-refs-new packed-refs
- bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
.env: &env
tags:
- redshift-docker-python
before_script:
- export PYENV_ROOT="$HOME/.pyenv"
- export PATH="$PYENV_ROOT/bin:$PATH"
- eval "$(pyenv init -)"
- pyenv shell $PYENV_PYTHON_VERSION
- export PATH=/opt/qt/5.9/5.9.4/gcc_64/bin:$PATH
- export DISPLAY=:99
build_and_test: &build_and_test
<<: *env
stage: build_and_test
script:
- pip install wheel
- pip install pytest-cov
- pip install -r requirements.txt
- python gen_resources.py
- python gen_translations.py --lrelease
- python setup.py bdist_wheel
- py.test --cov=sakia tests/
releases:
<<: *env
stage: release
when: manual
script:
- pip install -r requirements.txt
- pip install wheel
- pip install twine
- python setup.py bdist_wheel
- twine upload dist/* --username duniter --password $PYPI_PASSWORD
...@@ -38,6 +38,7 @@ deploy: ...@@ -38,6 +38,7 @@ deploy:
file: file:
- sakia-${TRAVIS_OS_NAME}.deb - sakia-${TRAVIS_OS_NAME}.deb
- sakia-${TRAVIS_OS_NAME}.zip - sakia-${TRAVIS_OS_NAME}.zip
- sakia-${TRAVIS_TAG}-py3-none-any.whl
skip_cleanup: true skip_cleanup: true
on: on:
tags: true tags: true
......
...@@ -3,11 +3,10 @@ ...@@ -3,11 +3,10 @@
![sakia logo](https://raw.github.com/duniter/sakia/master/sakia.png) ![sakia logo](https://raw.github.com/duniter/sakia/master/sakia.png)
# Sakia # Sakia
[![Coverage Status](https://coveralls.io/repos/duniter/sakia/badge.svg?branch=dev)](https://coveralls.io/r/duniter/sakia) [![coverage report](https://git.duniter.org/clients/python/sakia/badges/gitlab/coverage.svg)](https://git.duniter.org/clients/python/sakia/commits/gitlab)
[![pipeline status](https://git.duniter.org/clients/python/sakia/badges/gitlab/pipeline.svg)](https://git.duniter.org/clients/python/sakia/commits/gitlab)
[![Build Status](https://travis-ci.org/duniter/sakia.svg?branch=travis)](https://travis-ci.org/duniter/sakia) [![Build Status](https://travis-ci.org/duniter/sakia.svg?branch=travis)](https://travis-ci.org/duniter/sakia)
[![Build status](https://ci.appveyor.com/api/projects/status/pvl18xon8pvu2c8w/branch/dev?svg=true)](https://ci.appveyor.com/project/Insoleet/sakia-bee4m/branch/dev) [![Build status](https://ci.appveyor.com/api/projects/status/pvl18xon8pvu2c8w/branch/dev?svg=true)](https://ci.appveyor.com/project/Insoleet/sakia-bee4m/branch/dev)
[![Translation status](http://weblate.duniter.org/widgets/sakia/-/svg-badge.svg)](http://weblate.duniter.org/engage/sakia/?utm_source=widget)
[![Code Issues](https://www.quantifiedcode.com/api/v1/project/3fff212226eb4027a586bc32e32d909b/badge.svg)](https://www.quantifiedcode.com/app/project/3fff212226eb4027a586bc32e32d909b)
======== ========
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#error "Unable to find MyAppExe" #error "Unable to find MyAppExe"
#endif #endif
#define MyAppVerStr "0.32.10" #define MyAppVerStr "0.32.10post1"
[Setup] [Setup]
AppName={#MyAppName} AppName={#MyAppName}
......
#!/usr/bin/env bash #!/usr/bin/env bash
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)" eval "$(pyenv init -)"
cd $HOME/build/duniter/sakia cd $HOME/build/duniter/sakia
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
if [ $TRAVIS_OS_NAME == "osx" ] if [ $TRAVIS_OS_NAME == "osx" ]
then then
zip -r sakia-${TRAVIS_OS_NAME}.zip dist/ zip -r sakia-${TRAVIS_OS_NAME}.zip dist/sakia.app/
elif [ $TRAVIS_OS_NAME == "linux" ] elif [ $TRAVIS_OS_NAME == "linux" ]
then then
zip -r sakia-${TRAVIS_OS_NAME}.zip dist/ zip -r sakia-${TRAVIS_OS_NAME}.zip dist/sakia/
# Debian package # Debian package
chmod 755 ci/travis/debian/DEBIAN/post* chmod 755 ci/travis/debian/DEBIAN/post*
......
...@@ -11,14 +11,12 @@ fi ...@@ -11,14 +11,12 @@ fi
if [ $TRAVIS_OS_NAME == "osx" ] if [ $TRAVIS_OS_NAME == "osx" ]
then then
brew tap homebrew/versions
brew update brew update
brew install libsodium brew install libsodium
## Ensure your brew QT version is up to date. (brew install qt -> qt 4.8) ## Ensure your brew QT version is up to date. (brew install qt -> qt 4.8)
brew install qt5 brew install qt5
brew list qt5 brew list qt5
brew install pyenv-virtualenv brew install pyenv-virtualenv
pyenv update
elif [ $TRAVIS_OS_NAME == "linux" ] elif [ $TRAVIS_OS_NAME == "linux" ]
then then
sudo apt-get update sudo apt-get update
...@@ -31,7 +29,7 @@ then ...@@ -31,7 +29,7 @@ then
dbus-x11 dbus-x11
wget https://download.qt.io/official_releases/qt/5.9/5.9.4/qt-opensource-linux-x64-5.9.4.run wget https://download.qt.io/official_releases/qt/5.9/5.9.4/qt-opensource-linux-x64-5.9.4.run
chmod +x qt-opensource-linux-x64-5.9.4.run chmod +x qt-opensource-linux-x64-5.9.4.run
./qt-opensource-linux-x64-5.9.4.run --script $HOME/build/duniter/sakia/ci/travis/qt-installer-noninteractive.qs ./qt-opensource-linux-x64-5.9.4.run -v --script $HOME/build/duniter/sakia/ci/travis/qt-installer-noninteractive.qs
wget http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsodium/libsodium18_1.0.13-1_amd64.deb wget http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsodium/libsodium18_1.0.13-1_amd64.deb
sudo dpkg -i libsodium18_1.0.13-1_amd64.deb sudo dpkg -i libsodium18_1.0.13-1_amd64.deb
...@@ -48,6 +46,7 @@ fi ...@@ -48,6 +46,7 @@ fi
eval "$(pyenv init -)" eval "$(pyenv init -)"
pyenv update
pyenv install --list pyenv install --list
if [ $TRAVIS_OS_NAME == "osx" ] if [ $TRAVIS_OS_NAME == "osx" ]
then then
......
...@@ -11,7 +11,8 @@ pip install --upgrade pip ...@@ -11,7 +11,8 @@ pip install --upgrade pip
pyenv rehash pyenv rehash
pip install coveralls pip install coveralls
pip install pytest-cov pip install pytest-cov
pip install pyinstaller==3.2 pip install pyinstaller==3.3.1
pip install wheel
pip install -r requirements.txt pip install -r requirements.txt
if [ $TRAVIS_OS_NAME == "linux" ] if [ $TRAVIS_OS_NAME == "linux" ]
then then
...@@ -34,10 +35,11 @@ if [ $TRAVIS_OS_NAME == "osx" ] ...@@ -34,10 +35,11 @@ if [ $TRAVIS_OS_NAME == "osx" ]
then then
pyinstaller sakia.spec pyinstaller sakia.spec
cp -rv dist/sakia/* dist/sakia.app/Contents/MacOS cp -rv dist/sakia/* dist/sakia.app/Contents/MacOS
cp -va dist/sakia/* dist/sakia.app/Contents/MacOS
cp -v res/osx/Info.plist dist/sakia.app/Contents/ cp -v res/osx/Info.plist dist/sakia.app/Contents/
rm -rfv dist/sakia rm -rfv dist/sakia
elif [ $TRAVIS_OS_NAME == "linux" ] elif [ $TRAVIS_OS_NAME == "linux" ]
then then
pyinstaller sakia.spec pyinstaller sakia.spec
rm -f dist/sakia/libdrm.so.2
python setup.py bdist_wheel
fi fi
Package: sakia Package: sakia
Version: 0.32.10 Version: 0.32.10post1
Section: misc Section: misc
Priority: optional Priority: optional
Architecture: all Architecture: all
......
...@@ -26,9 +26,9 @@ Controller.prototype.TargetDirectoryPageCallback = function() ...@@ -26,9 +26,9 @@ Controller.prototype.TargetDirectoryPageCallback = function()
} }
Controller.prototype.ComponentSelectionPageCallback = function() { Controller.prototype.ComponentSelectionPageCallback = function() {
//var widget = gui.currentPageWidget(); var widget = gui.currentPageWidget();
//widget.selectAll(); widget.selectAll();
gui.clickButton(buttons.NextButton); gui.clickButton(buttons.NextButton);
} }
......
[Desktop Entry] [Desktop Entry]
Version=0.32.10 Version=0.32.10post1
Name=Sakia Name=Sakia
Comment=Duniter Qt Client Comment=Duniter Qt Client
Exec=sakia Exec=sakia
......
__version_info__ = ('0', '32', '10') __version_info__ = ('0', '32', '10post1')
__version__ = '.'.join(__version_info__) __version__ = '.'.join(__version_info__)
...@@ -3,8 +3,8 @@ import yaml ...@@ -3,8 +3,8 @@ import yaml
MAX_CONFIRMATIONS = 6 MAX_CONFIRMATIONS = 6
with open(os.path.join(os.path.dirname(__file__), "root_servers.yml"), 'r') as stream: with open(os.path.join(os.path.dirname(__file__), "root_servers.yml"), 'r', encoding="utf-8") as stream:
ROOT_SERVERS = yaml.load(stream) ROOT_SERVERS = yaml.load(stream)
with open(os.path.join(os.path.dirname(__file__), "g1_licence.html"), 'r') as stream: with open(os.path.join(os.path.dirname(__file__), "g1_licence.html"), 'r', encoding="utf-8") as stream:
G1_LICENCE = stream.read() G1_LICENCE = stream.read()
...@@ -113,10 +113,10 @@ class NodeConnector(QObject): ...@@ -113,10 +113,10 @@ class NodeConnector(QObject):
else: else:
raise raise
except (ClientError, gaierror, TimeoutError, ConnectionRefusedError, ValueError) as e: except (ClientError, gaierror, TimeoutError, ConnectionRefusedError, ValueError) as e:
self._logger.debug("{0}".format(str(e))) self._logger.debug("{:}:{:}".format(str(e.__class__.__name__), str(e)))
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
except jsonschema.ValidationError as e: except jsonschema.ValidationError as e:
self._logger.debug(str(e)) self._logger.debug("{:}:{:}".format(str(e.__class__.__name__), str(e)))
self.change_state_and_emit(Node.CORRUPTED) self.change_state_and_emit(Node.CORRUPTED)
except RuntimeError: except RuntimeError:
if self.session.closed: if self.session.closed:
...@@ -187,8 +187,7 @@ class NodeConnector(QObject): ...@@ -187,8 +187,7 @@ class NodeConnector(QObject):
self._logger.debug("{0} : {1}".format(str(e), self.node.pubkey[:5])) self._logger.debug("{0} : {1}".format(str(e), self.node.pubkey[:5]))
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
except jsonschema.ValidationError as e: except jsonschema.ValidationError as e:
self._logger.debug(str(e)) self._logger.debug("{:}:{:}".format(str(e.__class__.__name__), str(e)))
self._logger.debug("Validation error")
self.change_state_and_emit(Node.CORRUPTED) self.change_state_and_emit(Node.CORRUPTED)
except RuntimeError: except RuntimeError:
if self.session.closed: if self.session.closed:
...@@ -219,6 +218,9 @@ class NodeConnector(QObject): ...@@ -219,6 +218,9 @@ class NodeConnector(QObject):
else: else:
self.change_state_and_emit(Node.CORRUPTED) self.change_state_and_emit(Node.CORRUPTED)
self._logger.debug("Error in block reply : {0}".format(str(e))) self._logger.debug("Error in block reply : {0}".format(str(e)))
else:
if self.session.closed:
pass
else: else:
self._logger.debug("Could not connect to any BMA endpoint") self._logger.debug("Could not connect to any BMA endpoint")
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
...@@ -257,6 +259,9 @@ class NodeConnector(QObject): ...@@ -257,6 +259,9 @@ class NodeConnector(QObject):
self._logger.debug("Changed block {0} -> {1}".format(self.node.current_buid.number, self._logger.debug("Changed block {0} -> {1}".format(self.node.current_buid.number,
block_data['number'])) block_data['number']))
self.changed.emit() self.changed.emit()
else:
if self.session.closed:
pass
else: else:
self._logger.debug("Could not connect to any BMA endpoint") self._logger.debug("Could not connect to any BMA endpoint")
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
...@@ -282,6 +287,9 @@ class NodeConnector(QObject): ...@@ -282,6 +287,9 @@ class NodeConnector(QObject):
except errors.DuniterError as e: except errors.DuniterError as e:
self._logger.debug("Error in summary : {:}".format(str(e))) self._logger.debug("Error in summary : {:}".format(str(e)))
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
else:
if self.session.closed:
pass
else: else:
self._logger.debug("Could not connect to any BMA endpoint") self._logger.debug("Could not connect to any BMA endpoint")
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
...@@ -314,10 +322,10 @@ class NodeConnector(QObject): ...@@ -314,10 +322,10 @@ class NodeConnector(QObject):
.format(type(e).__name__, str(e))) .format(type(e).__name__, str(e)))
await self.request_peers() await self.request_peers()
except (ClientError, gaierror, TimeoutError) as e: except (ClientError, gaierror, TimeoutError) as e:
self._logger.debug("{0}".format(str(e))) self._logger.debug("{:}:{:}".format(str(e.__class__.__name__), str(e)))
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
except jsonschema.ValidationError as e: except jsonschema.ValidationError as e:
self._logger.debug(str(e)) self._logger.debug("{:}:{:}".format(str(e.__class__.__name__), str(e)))
self.change_state_and_emit(Node.CORRUPTED) self.change_state_and_emit(Node.CORRUPTED)
except RuntimeError: except RuntimeError:
if self.session.closed: if self.session.closed:
...@@ -359,7 +367,7 @@ class NodeConnector(QObject): ...@@ -359,7 +367,7 @@ class NodeConnector(QObject):
if e.ucode == 2012: if e.ucode == 2012:
# Since with multinodes, peers or not the same on all nodes, sometimes this request results # Since with multinodes, peers or not the same on all nodes, sometimes this request results
# in peer not found error # in peer not found error
self._logger.debug(str(e)) self._logger.debug("{:}:{:}".format(str(e.__class__.__name__), str(e)))
else: else:
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
self._logger.debug("Incorrect peer data in {leaf} : {err}".format(leaf=leaf_hash, err=str(e))) self._logger.debug("Incorrect peer data in {leaf} : {err}".format(leaf=leaf_hash, err=str(e)))
...@@ -370,6 +378,9 @@ class NodeConnector(QObject): ...@@ -370,6 +378,9 @@ class NodeConnector(QObject):
except errors.DuniterError as e: except errors.DuniterError as e:
self._logger.debug("Error in peers reply : {0}".format(str(e))) self._logger.debug("Error in peers reply : {0}".format(str(e)))
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
else:
if self.session.closed:
pass
else: else:
self._logger.debug("Could not connect to any BMA endpoint") self._logger.debug("Could not connect to any BMA endpoint")
self.change_state_and_emit(Node.OFFLINE) self.change_state_and_emit(Node.OFFLINE)
...@@ -382,7 +393,7 @@ class NodeConnector(QObject): ...@@ -382,7 +393,7 @@ class NodeConnector(QObject):
peer_doc = Peer.from_signed_raw(str_doc) peer_doc = Peer.from_signed_raw(str_doc)
self.neighbour_found.emit(peer_doc) self.neighbour_found.emit(peer_doc)
except MalformedDocumentError as e: except MalformedDocumentError as e:
self._logger.debug(str(e)) self._logger.debug("{:}:{:}".format(str(e.__class__.__name__), str(e)))
else: else:
self._logger.debug("Incorrect leaf reply") self._logger.debug("Incorrect leaf reply")
......
import locale
import asyncio import asyncio
import logging import logging
import signal import signal
...@@ -18,6 +19,30 @@ from sakia.gui.preferences import PreferencesDialog ...@@ -18,6 +19,30 @@ from sakia.gui.preferences import PreferencesDialog
from sakia.gui.widgets import QAsyncMessageBox from sakia.gui.widgets import QAsyncMessageBox
def exit_exception_handler(loop, context):
"""
An exception handler which prints only on debug (used when exiting)
:param loop: the asyncio loop
:param context: the exception context
"""
logging.debug('Exception handler executing')
message = context.get('message')
if not message:
message = 'Unhandled exception in event loop'
try:
exception = context['exception']
except KeyError:
exc_info = False
else:
exc_info = (type(exception), exception, exception.__traceback__)
logging.debug("An unhandled exception occured : {0}".format(message),
exc_info=exc_info)
def async_exception_handler(loop, context): def async_exception_handler(loop, context):
""" """
An exception handler which exits the program if the exception An exception handler which exits the program if the exception
...@@ -85,7 +110,7 @@ def main(): ...@@ -85,7 +110,7 @@ def main():
sys.excepthook = exception_handler sys.excepthook = exception_handler
sakia.setStyle('Fusion') #sakia.setStyle('Fusion')
loop = QSelectorEventLoop(sakia) loop = QSelectorEventLoop(sakia)
loop.set_exception_handler(async_exception_handler) loop.set_exception_handler(async_exception_handler)
#loop.set_debug(True) #loop.set_debug(True)
...@@ -131,7 +156,7 @@ def main(): ...@@ -131,7 +156,7 @@ def main():
window = MainWindowController.startup(app) window = MainWindowController.startup(app)
loop.run_forever() loop.run_forever()
try: try:
loop.set_exception_handler(None) loop.set_exception_handler(exit_exception_handler)
loop.run_until_complete(app.stop_current_profile()) loop.run_until_complete(app.stop_current_profile())
logging.debug("Application stopped") logging.debug("Application stopped")
except asyncio.CancelledError: except asyncio.CancelledError:
......
...@@ -5,6 +5,7 @@ import sqlite3 ...@@ -5,6 +5,7 @@ import sqlite3
import mirage import mirage
import sys import sys
import os import os
import locale
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src'))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src')))
...@@ -20,7 +21,6 @@ from sakia.services import DocumentsService ...@@ -20,7 +21,6 @@ from sakia.services import DocumentsService
_application_ = [] _application_ = []
@pytest.yield_fixture @pytest.yield_fixture
def event_loop(): def event_loop():
qapplication = get_application() qapplication = get_application()
......