From 7de4340c38d0dafd1a89dfa8ccea1ee5be8c7664 Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Tue, 1 Nov 2016 13:26:03 -0500 Subject: [PATCH 1/2] lint the osx and windows apps This also fixes a trivial bug in the osx release. --- packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py | 3 --- packaging/osx/lbry-osx-app/lbrygui/main.py | 2 +- packaging/osx/lbry-osx-app/setup_app.sh | 5 +++++ packaging/windows/lbry-win32-app/LBRYWin32App.py | 3 --- packaging/windows/test.ps1 | 1 + 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py b/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py index 48155576b..72f27755e 100644 --- a/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py +++ b/packaging/osx/lbry-osx-app/lbrygui/LBRYApp.py @@ -7,7 +7,6 @@ import platform import shutil from appdirs import user_data_dir from twisted.internet import reactor -from twisted.web import server import Foundation bundle = Foundation.NSBundle.mainBundle() lbrycrdd_path = bundle.pathForResource_ofType_('lbrycrdd', None) @@ -22,9 +21,7 @@ if not os.path.isfile(lbrycrdd_path_conf): f.write(lbrycrdd_path) f.close() -from lbrynet.lbrynet_daemon.DaemonServer import DaemonServer from lbrynet.lbrynet_daemon import DaemonControl -from lbrynet.lbrynet_daemon.DaemonRequest import DaemonRequest from lbrynet.conf import settings from lbrynet.core import utils diff --git a/packaging/osx/lbry-osx-app/lbrygui/main.py b/packaging/osx/lbry-osx-app/lbrygui/main.py index ba9240a7f..17a3ee838 100644 --- a/packaging/osx/lbry-osx-app/lbrygui/main.py +++ b/packaging/osx/lbry-osx-app/lbrygui/main.py @@ -15,7 +15,7 @@ log = logging.getLogger() def main(): conf.update_settings_from_file() - log_file = settings.get_log_filename() + log_file = conf.settings.get_log_filename() log_support.configure_logging(log_file, console=True) app = LBRYDaemonApp.sharedApplication() reactor.addSystemEventTrigger("after", "shutdown", AppHelper.stopEventLoop) diff --git a/packaging/osx/lbry-osx-app/setup_app.sh b/packaging/osx/lbry-osx-app/setup_app.sh index 6ee0c27b0..5fe6861a6 100755 --- a/packaging/osx/lbry-osx-app/setup_app.sh +++ b/packaging/osx/lbry-osx-app/setup_app.sh @@ -61,6 +61,11 @@ VERSION=`python setup.py -V` pip install -r requirements.txt # not totally sure if pyOpenSSl is needed (JIE) pip install pyOpenSSL + +pip install pylint +pylint -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils \ + --enable=unused-import lbrynet packaging/osx/lbry-osx-app/lbrygui/ + python setup.py install echo "Building URI Handler" diff --git a/packaging/windows/lbry-win32-app/LBRYWin32App.py b/packaging/windows/lbry-win32-app/LBRYWin32App.py index abfbdf89c..988227a54 100644 --- a/packaging/windows/lbry-win32-app/LBRYWin32App.py +++ b/packaging/windows/lbry-win32-app/LBRYWin32App.py @@ -9,7 +9,6 @@ import win32con import win32gui_struct from jsonrpc.proxy import JSONRPCProxy from twisted.internet import reactor, error -from twisted.web import server try: import winxpgui as win32gui @@ -20,8 +19,6 @@ from lbrynet import conf from lbrynet.core import log_support from lbrynet.core import utils from lbrynet.lbrynet_daemon import DaemonControl -from lbrynet.lbrynet_daemon.DaemonServer import DaemonServer -from lbrynet.lbrynet_daemon.DaemonRequest import DaemonRequest from lbrynet.conf import settings from packaging.uri_handler.LBRYURIHandler import LBRYURIHandler diff --git a/packaging/windows/test.ps1 b/packaging/windows/test.ps1 index 4128f327a..fa12e8602 100644 --- a/packaging/windows/test.ps1 +++ b/packaging/windows/test.ps1 @@ -1,4 +1,5 @@ C:\Python27\Scripts\pip.exe install mock C:\Python27\Scripts\pip.exe install pylint C:\Python27\python.exe C:\Python27\Scripts\trial.py C:\projects\lbry\tests\unit +C:\Python27\Scripts\pylint.exe -E --disable=inherit-non-class --disable=no-member --ignored-modules=distutils --enable=unused-import lbrynet packaging/windows/lbry-win32-app/LBRYWin32App.py if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } From c0d96a57330c88f3c90dcbc27449ad90c03e2c27 Mon Sep 17 00:00:00 2001 From: Job Evers-Meltzer Date: Tue, 1 Nov 2016 14:17:20 -0500 Subject: [PATCH 2/2] fix bug in jsonrpc_get_settings --- lbrynet/conf.py | 2 +- lbrynet/lbrynet_daemon/Daemon.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lbrynet/conf.py b/lbrynet/conf.py index 30a783616..c96c3a95e 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -198,7 +198,7 @@ class ApplicationSettings(Setting): self.ICON_PATH = "icons" if platform is WINDOWS else "app.icns" self.APP_NAME = "LBRY" self.PROTOCOL_PREFIX = "lbry" - self.wallet_TYPES = ["lbryum", "lbrycrd"] + self.WALLET_TYPES = ["lbryum", "lbrycrd"] self.SOURCE_TYPES = ['lbry_sd_hash', 'url', 'btih'] self.CURRENCIES = { 'BTC': {'type': 'crypto'}, diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 58aef6e17..23eaf6df6 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -1249,7 +1249,7 @@ class Daemon(AuthJSONRPCServer): """ log.info("Get daemon settings") - return self._render_response(lbrynet_settings.configurable_settings, OK_CODE) + return self._render_response(lbrynet_settings.__dict__, OK_CODE) @AuthJSONRPCServer.auth_required def jsonrpc_set_settings(self, p):