Travis CI: Use flake8 to find Python syntax errors and undefined names (#5467)

This commit is contained in:
Christian Clauss 2019-08-12 00:35:23 +02:00 committed by ghost43
parent 9eebb306f2
commit e34afd62ce
4 changed files with 11 additions and 13 deletions

View file

@ -1,4 +1,3 @@
sudo: true
dist: xenial
language: python
python:
@ -29,7 +28,6 @@ jobs:
include:
- stage: binary builds
name: "Windows build"
sudo: true
language: c
python: false
env:
@ -72,7 +70,6 @@ jobs:
after_script: ls -lah dist && md5 dist/*
after_success: true
- name: "AppImage build"
sudo: true
language: c
python: false
services:
@ -82,6 +79,10 @@ jobs:
script:
- sudo docker run --name electrum-appimage-builder-cont -v $PWD:/opt/electrum --rm --workdir /opt/electrum/contrib/build-linux/appimage electrum-appimage-builder-img ./build.sh
after_success: true
- name: "Flake8 tests"
language: python
install: pip install flake8
script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- stage: release check
install:
- git fetch --all --tags

View file

@ -257,7 +257,7 @@ def get_logfile_path() -> Optional[pathlib.Path]:
def describe_os_version() -> str:
if 'ANDROID_DATA' in os.environ:
from kivy import utils
if utils.platform is not "android":
if utils.platform != "android":
return utils.platform
import jnius
bv = jnius.autoclass('android.os.Build$VERSION')

View file

@ -604,10 +604,7 @@ class Abstract_Wallet(AddressSynchronizer):
return item
def get_label(self, tx_hash):
label = self.labels.get(tx_hash, '')
if label is '':
label = self.get_default_label(tx_hash)
return label
return self.labels.get(tx_hash, '') or self.get_default_label(tx_hash)
def get_default_label(self, tx_hash):
if not self.db.get_txi(tx_hash):