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
  • check_uniq_node_by_endpoints
  • dev
  • feature/agent_architecture
  • feature/backend
  • fix_ci
  • fix_ci_osx
  • fix_dbus_error
  • fix_gitlab
  • fix_travis#1105
  • fixappveyor
  • gitlab
  • landscape
  • master
  • pyinstaller
  • pyqt5.6
  • qt5.7
  • qtwebengine
  • sakia020
  • translations
  • wip/data_path
  • wip/fix_pyqt
  • wip/python3_syntax
  • 0.1.0
  • 0.10.0
  • 0.10.1
  • 0.10.2
  • 0.11.0
  • 0.11.1
  • 0.11.2
  • 0.11.3
  • 0.11.4
  • 0.11.4.post1
  • 0.11.5
  • 0.12.0
  • 0.12.1dev1
  • 0.12.1dev2
  • 0.12.1dev3
  • 0.12.1dev4
  • 0.12.dev1
  • 0.12.dev2
  • 0.12.dev3
  • 0.12.dev4
  • 0.12.dev5
  • 0.12rc1
  • 0.2.0
  • 0.2.1
  • 0.20.0
  • 0.20.0dev1
  • 0.20.0dev10
  • 0.20.0dev12
  • 0.20.0dev13
  • 0.20.0dev14
  • 0.20.0dev15
  • 0.20.0dev16
  • 0.20.0dev2
  • 0.20.0dev3
  • 0.20.0dev3-test1
  • 0.20.0dev4
  • 0.20.0dev5
  • 0.20.0dev6
  • 0.20.0dev7
  • 0.20.0dev8
  • 0.20.0dev9
  • 0.20.1
  • 0.20.10
  • 0.20.11
  • 0.20.13
  • 0.20.2
  • 0.20.3
  • 0.20.4
  • 0.20.5
  • 0.20.6
  • 0.20.7
  • 0.20.8
  • 0.20.9
  • 0.3.0
  • 0.30.0
  • 0.30.0beta
  • 0.30.0beta1
  • 0.30.0beta2
  • 0.30.0beta3
  • 0.30.0beta4
  • 0.30.0beta5
  • 0.30.0beta6
  • 0.30.0beta7
  • 0.30.0beta8
  • 0.30.0beta9
  • 0.30.1
  • 0.30.10
  • 0.30.11
  • 0.30.12
  • 0.30.13
  • 0.30.14
  • 0.30.2
  • 0.30.3
  • 0.30.4
  • 0.30.5
  • 0.30.6
  • 0.30.7
  • 0.30.8
  • 0.30.9
  • 0.31.0
  • 0.31.0.post1
  • 0.31.1
  • 0.31.2
  • 0.31.3
  • 0.31.4
  • 0.31.5
  • 0.31.6
  • 0.32.0
  • 0.32.0-linux
  • 0.32.0RC1
  • 0.32.0RC2
  • 0.32.0RC3
  • 0.32.0RC4
  • 0.32.0RC5
  • 0.32.0RC6
  • 0.32.1
  • 0.32.10
  • 0.32.10post1
  • 0.32.2
  • 0.32.3
122 results

Target

Select target project
  • cebash/sakia
  • santiago/sakia
  • jonas/sakia
3 results
Select Git revision
  • check_uniq_node_by_endpoints
  • dev
  • feature/agent_architecture
  • feature/backend
  • fix_ci
  • fix_ci_osx
  • fix_dbus_error
  • fix_gitlab
  • fix_travis#1105
  • fixappveyor
  • gitlab
  • landscape
  • master
  • pyinstaller
  • pyqt5.6
  • qt5.7
  • qtwebengine
  • sakia020
  • translations
  • wip/data_path
  • wip/fix_pyqt
  • wip/python3_syntax
  • 0.1.0
  • 0.10.0
  • 0.10.1
  • 0.10.2
  • 0.11.0
  • 0.11.1
  • 0.11.2
  • 0.11.3
  • 0.11.4
  • 0.11.4.post1
  • 0.11.5
  • 0.12.0
  • 0.12.1dev1
  • 0.12.1dev2
  • 0.12.1dev3
  • 0.12.1dev4
  • 0.12.dev1
  • 0.12.dev2
  • 0.12.dev3
  • 0.12.dev4
  • 0.12.dev5
  • 0.12rc1
  • 0.2.0
  • 0.2.1
  • 0.20.0
  • 0.20.0dev1
  • 0.20.0dev10
  • 0.20.0dev12
  • 0.20.0dev13
  • 0.20.0dev14
  • 0.20.0dev15
  • 0.20.0dev16
  • 0.20.0dev2
  • 0.20.0dev3
  • 0.20.0dev3-test1
  • 0.20.0dev4
  • 0.20.0dev5
  • 0.20.0dev6
  • 0.20.0dev7
  • 0.20.0dev8
  • 0.20.0dev9
  • 0.20.1
  • 0.20.10
  • 0.20.11
  • 0.20.13
  • 0.20.2
  • 0.20.3
  • 0.20.4
  • 0.20.5
  • 0.20.6
  • 0.20.7
  • 0.20.8
  • 0.20.9
  • 0.3.0
  • 0.30.0
  • 0.30.0beta
  • 0.30.0beta1
  • 0.30.0beta2
  • 0.30.0beta3
  • 0.30.0beta4
  • 0.30.0beta5
  • 0.30.0beta6
  • 0.30.0beta7
  • 0.30.0beta8
  • 0.30.0beta9
  • 0.30.1
  • 0.30.10
  • 0.30.11
  • 0.30.12
  • 0.30.13
  • 0.30.14
  • 0.30.2
  • 0.30.3
  • 0.30.4
  • 0.30.5
  • 0.30.6
  • 0.30.7
  • 0.30.8
  • 0.30.9
  • 0.31.0
  • 0.31.0.post1
  • 0.31.1
  • 0.31.2
  • 0.31.3
  • 0.31.4
  • 0.31.5
  • 0.31.6
  • 0.32.0
  • 0.32.0-linux
  • 0.32.0RC1
  • 0.32.0RC2
  • 0.32.0RC3
  • 0.32.0RC4
  • 0.32.0RC5
  • 0.32.0RC6
  • 0.32.1
  • 0.32.10
  • 0.32.10post1
  • 0.32.2
  • 0.32.3
122 results
Show changes
Commits on Source (6)
......@@ -8,7 +8,7 @@ SHELL := /bin/bash
tests:
python3 gen_resources.py
python3 gen_translations.py
pytest -q -s --disable-warnings ${TESTS_FILTER}
pytest -q -s --disable-warnings tests ${TESTS_FILTER}
# check
check: mypy pylint check-format
......
<!-- Landscape | [![Code Health](https://landscape.io/github/duniter/sakia/dev/landscape.svg?style=flat)](https://landscape.io/github/duniter/sakia/dev) -->
![sakia logo](https://raw.github.com/duniter/sakia/master/sakia.png)
![sakia logo](https://git.duniter.org/clients/python/sakia/-/raw/master/sakia.png)
# Sakia
[![coverage report](https://git.duniter.org/clients/python/sakia/badges/gitlab/coverage.svg)](https://git.duniter.org/clients/python/sakia/commits/gitlab)
......@@ -8,11 +6,8 @@
[![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)
========
Python3 and PyQt5 Client for [duniter](http://www.duniter.org) project.
### Features
* Accounts management
* Communities viewing
......@@ -25,40 +20,27 @@ Python3 and PyQt5 Client for [duniter](http://www.duniter.org) project.
### Dependencies
* Dependencies :
* Qt5
* [python3](https://www.python.org/downloads/)
* [python 3.6+](https://www.python.org/downloads/)
* [libsodium](http://doc.libsodium.org/installation/README.html)
* General tips : use pyenv to build sakia, as described in the [wiki](https://github.com/duniter/sakia/wiki/Cutecoin-install-for-developpers)
General tips : use [pyenv](https://github.com/pyenv/pyenv) to build sakia, as described in the [documentation](https://git.duniter.org/clients/python/sakia/-/blob/master/doc/install_for_developers.md)
Building Python with pyenv requires libraries of `openssl` and `sqlite3`. On Ubuntu, install it using the following commands :
Building python 3 with pyenv requires libraries of `openssl` and `sqlite3`. On Ubuntu, install it using the following commands :
```
apt-get update
apt-get install libssl-dev
apt-get install libsqlite3-dev
```
### Wheel Build scripts
* Install __wheel__ with `pip install wheel`
* Run `python3 gen_resources.py` in sakia folder
* Run `python3 gen_translations.py` in sakia folder
* To build the wheel : Run `python3 setup.py bdist_wheel` in sakia folder
### Pyinstaller Build scripts
* Install __pyinstaller__ with `pip install pyinstaller`
* Run `python3 gen_resources.py` in sakia folder
* Run `python3 gen_translations.py` in sakia folder
* To build the binaries : Run `pyinstall sakia.spec`
### Install with pip
* Run `pip install sakia`
* start "sakia" :)
### Download latest release
* Go to [current release](https://github.com/duniter/sakia/releases)
* Download corresponding package to your operating system
* Unzip and start "sakia" :)
* Join our beta community by contacting us on [duniter forum](http://forum.duniter.org/)
* Go to [current release](https://git.duniter.org/clients/python/sakia/-/releases)
* Download AppImage for linux x86_64. Run it !
* Join our developer community by contacting us on [duniter forum](http://forum.duniter.org/)
## Command line options
......@@ -67,88 +49,98 @@ apt-get install libsqlite3-dev
`--currency g1-test` to connect to the g1-test currency network.
## Development
* When writing docstrings, use the reStructuredText format recommended by https://www.python.org/dev/peps/pep-0287/#docstring-significant-features
* When writing docstrings, use the reStructuredText format recommended by [PEP 0287](https://www.python.org/dev/peps/pep-0287/#docstring-significant-features)
* Use make commands to check the code and the format it correct.
The development tools require Python 3.6.x or higher.
* Create a python virtual environment with [pyenv](https://github.com/pyenv/pyenv)
```bash
* Install a supported Python version with [pyenv](https://github.com/pyenv/pyenv)
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
```
* Create a virtualenv in the project folder:
python -m venv .venv
* Install dependencies
```bash
pip install -r requirements.txt
```
* Run Sakia from the source code
```bash
PYTHONPATH="`pwd`/src/." python src/sakia/main.py
```
* Before submiting a merge requests, please check the static typing and tests.
* Install dev dependencies
```bash
pip install -r requirements_dev.txt
```
* Check static typing with [mypy](http://mypy-lang.org/)
```bash
make check
```
* Run all unit tests (pytest module) with:
```bash
make tests
```
> **Warning:** *do not run tests with sakia installed in your dev environment, because pytest will use the installed Sakia.*
* Run only some unit tests by passing a special ENV variable:
```bash
make tests TESTS_FILTER=tests/functional/test_transfer_dialog.py::test_transfer
```
## Packaging and deploy
### PyPi
In the development pyenv environment, install the tools to build and deploy
```bash
pip install --upgrade -r requirements_deploy.txt
```
Change and commit and tag the new version number (semantic version number)
```bash
./release.sh 0.x.y
```
Build the PyPi package in the `dist` folder
```bash
make build
```
Deploy the package to PyPi test repository (prefix the command with a space in order for the shell not to save in its history system the command containing the password)
```bash
[SPACE]make deploy_test PYPI_TEST_LOGIN=xxxx PYPI_TEST_PASSWORD=xxxx
```
Install the package from PyPi test repository
```bash
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.python.org/simple/ sakia
```
Deploy the package on the PyPi repository (prefix the command with a space in order for the shell not to save in its history system the command containing the password)
```bash
[SPACE]make deploy PYPI_LOGIN=xxxx PYPI_PASSWORD=xxxx
```
### Wheel Build scripts
make build
Or manually:
* Install __wheel__ with `pip install wheel`
* Run `python3 gen_resources.py` in sakia folder
* Run `python3 gen_translations.py` in sakia folder
* To build the wheel : Run `python3 setup.py bdist_wheel` in sakia folder
### AppImage
```bash
make appimage
```
The make command will do a wheel build, then create the AppImage file `ci/appimage/Sakia_x86_64.AppImage`
### Pyinstaller Build scripts (not maintained)
* Install __pyinstaller__ with `pip install pyinstaller`
* Run `python3 gen_resources.py` in sakia folder
* Run `python3 gen_translations.py` in sakia folder
* To build the binaries : Run `pyinstall sakia.spec`
## License
This software is distributed under [GNU GPLv3](https://raw.github.com/duniter/sakia/dev/LICENSE).
This software is distributed under [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.html).
pypeg2
aiohttp==3.6.2
async-timeout==3.0.1
asynctest==0.13.0
attrs==19.3.0
duniterpy==0.57.*
jsonschema==3.2.0
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -21,7 +21,8 @@ from PyQt5.QtCore import (
QFile,
)
from . import __version__
from .options import SakiaOptions
from sakia.constants import GITLAB_RELEASES_API_URL, GITLAB_RELEASES_PAGE_URL
from sakia.options import SakiaOptions
from sakia.data.connectors import BmaConnector
from sakia.services import (
NetworkService,
......@@ -309,29 +310,19 @@ class Application(QObject):
async with aiohttp.ClientSession() as session:
async with async_timeout.timeout(10):
response = await session.get(
"https://api.github.com/repos/duniter/sakia/releases",
GITLAB_RELEASES_API_URL,
proxy=self.parameters.proxy(),
)
if response.status == 200:
releases = await response.json()
latest = None
for r in releases:
if not latest:
latest = r
else:
latest_date = datetime.datetime.strptime(
latest["published_at"], "%Y-%m-%dT%H:%M:%SZ"
)
date = datetime.datetime.strptime(
r["published_at"], "%Y-%m-%dT%H:%M:%SZ"
)
if latest_date < date:
latest = r
latest_version = latest["tag_name"]
if len(releases) > 0:
release = releases[0]
latest_version = release["tag_name"]
version = (
__version__ == latest_version,
latest_version,
latest["html_url"],
GITLAB_RELEASES_PAGE_URL,
)
logging.debug("Found version: {0}".format(latest_version))
logging.debug("Current version: {0}".format(__version__))
......@@ -342,7 +333,7 @@ class Application(QObject):
asyncio.TimeoutError,
socket.gaierror,
) as e:
self._logger.debug("Could not connect to github: {0}".format(str(e)))
self._logger.debug("Could not connect to gitlab: {0}".format(str(e)))
def save_parameters(self, parameters):
self.parameters = UserParametersFile.in_config_path(
......
......@@ -6,3 +6,9 @@ with open(
os.path.join(os.path.dirname(__file__), "g1_license.html"), "r", encoding="utf-8"
) as stream:
G1_LICENSE = stream.read()
GITLAB_RELEASES_PAGE_URL = "https://git.duniter.org/clients/python/sakia/-/releases"
GITLAB_RELEASES_API_URL = (
"https://git.duniter.org/api/v4/projects/clients%2Fpython%2Fsakia/releases"
)
GITLAB_NEW_ISSUE_PAGE_URL = "https://git.duniter.org/clients/python/sakia/-/issues/new"
......@@ -24,10 +24,10 @@ class Connection:
password = attr.ib(init=False, converter=str, default="", cmp=False, hash=False)
def is_identity(self):
return self.uid is not ""
return self.uid != ""
def is_wallet(self):
return self.uid is ""
return self.uid == ""
def title(self):
return "@".join([self.uid, self.pubkey[:11]])
......
from PyQt5.QtCore import QObject, QLocale, QDateTime
from PyQt5.QtCore import QObject, QLocale, QDateTime, QCoreApplication
from sakia.data.processors import ConnectionsProcessor
import attr
import math
......@@ -37,15 +37,18 @@ class ToolbarModel(QObject):
latest = self.app.available_version
version_info = ""
version_url = ""
url_text = ""
if not latest[0]:
version_info = "Latest release: {version}".format(version=latest[1])
version_url = latest[2]
url_text = QCoreApplication.translate("ToolbarView", "Download page")
new_version_text = """
<p><b>{version_info}</b></p>
<p><a href={version_url}>Download link</a></p>
<p><a href={version_url}>{url_text}</a></p>
""".format(
version_info=version_info, version_url=version_url
version_info=version_info, version_url=version_url, url_text=url_text
)
return """
<h1>Sakia</h1>
......
......@@ -64,7 +64,7 @@ class PasswordInputController(QObject):
return "", ""
def valid(self):
return self._password is not ""
return self._password != ""
def check_private_key(self, secret_key, password):
if detect_non_printable(secret_key):
......
......@@ -9,6 +9,8 @@ from PyQt5.QtCore import Qt, QObject, QCoreApplication
from PyQt5.QtWidgets import QApplication, QMessageBox, QDialog, QPushButton, QLabel
from duniterpy.api.errors import DuniterError
from sakia.constants import GITLAB_NEW_ISSUE_PAGE_URL
from sakia.helpers import single_instance_lock, cleanup_lock
from quamash import QSelectorEventLoop
from sakia.errors import NoPeerAvailable
......@@ -129,7 +131,9 @@ def exception_message(log_lines, exc_info):
QMessageBox.Critical,
"Critical error",
"""A critical error occured. Select the details to display it.
Please report it to <a href='https://github.com/duniter/sakia/issues/new/'>the developers github</a>""",
Please report it to <a href='{}'>the developers Gitlab</a>""".format(
GITLAB_NEW_ISSUE_PAGE_URL
),
QMessageBox.Ok,
QApplication.activeWindow(),
)
......