From 552444c85696c572e63ee970e322083b2ddf0bca Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Mon, 14 Aug 2017 11:09:47 +0200 Subject: [PATCH] remove src/lib --- .pylintrc | 2 +- {src/lib => mocks}/typing.py | 0 src/lib/__init__.py | 0 src/{lib => }/protobuf.py | 0 src/trezor/main.py | 24 +++--------------------- tests/common.py | 6 ++---- {src/lib => tests}/unittest.py | 0 7 files changed, 6 insertions(+), 26 deletions(-) rename {src/lib => mocks}/typing.py (100%) delete mode 100644 src/lib/__init__.py rename src/{lib => }/protobuf.py (100%) rename {src/lib => tests}/unittest.py (100%) diff --git a/.pylintrc b/.pylintrc index 769ae82151..53ff54dc09 100644 --- a/.pylintrc +++ b/.pylintrc @@ -2,4 +2,4 @@ init-hook='sys.path.append("mocks"); sys.path.append("src/lib")' [MESSAGES CONTROL] -disable=C0111,C0103,W0603,W0703 +disable=C0111,C0103,C0413,W0603,W0703 \ No newline at end of file diff --git a/src/lib/typing.py b/mocks/typing.py similarity index 100% rename from src/lib/typing.py rename to mocks/typing.py diff --git a/src/lib/__init__.py b/src/lib/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/lib/protobuf.py b/src/protobuf.py similarity index 100% rename from src/lib/protobuf.py rename to src/protobuf.py diff --git a/src/trezor/main.py b/src/trezor/main.py index dfafbcfdc6..b8167198ea 100644 --- a/src/trezor/main.py +++ b/src/trezor/main.py @@ -1,31 +1,13 @@ -import gc -import micropython -import sys - -sys.path.append('lib') - +from trezor import config from trezor import loop from trezor import workflow from trezor import log +config.init() + log.level = log.DEBUG -def perf_info(): - prev = 0 - peak = 0 - sleep = loop.sleep(100000) - while True: - gc.collect() - used = gc.mem_alloc() - if used != prev: - prev = used - peak = max(peak, used) - print('peak %d, used %d' % (peak, used)) - yield sleep - - def run(default_workflow): - # loop.schedule_task(perf_info()) workflow.start_default(default_workflow) loop.run_forever() diff --git a/tests/common.py b/tests/common.py index 5e473e1e82..de4e146adb 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,8 +1,6 @@ import sys - sys.path.append('../src') -sys.path.append('../src/lib') - -import unittest from ubinascii import hexlify, unhexlify + +import unittest \ No newline at end of file diff --git a/src/lib/unittest.py b/tests/unittest.py similarity index 100% rename from src/lib/unittest.py rename to tests/unittest.py