From 59773ca82979dd257f384b0bb549acc043618341 Mon Sep 17 00:00:00 2001 From: Daisuke Baba Date: Sat, 7 Jan 2017 15:39:28 +0900 Subject: [PATCH 1/5] Handle an unexpected error --- lib/candy_board_amt/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/candy_board_amt/__init__.py b/lib/candy_board_amt/__init__.py index 8ba93a6..a42d57b 100644 --- a/lib/candy_board_amt/__init__.py +++ b/lib/candy_board_amt/__init__.py @@ -259,6 +259,12 @@ def perform(self, cmd): return self.error_message("Invalid Args") except OSError: return self.error_message("I/O Error") + except: + return self.error_message("Unexpected error: %s" % + (''.join(traceback + .format_exception(*sys.exc_info())[-2:]) + .strip().replace('\n', ': ')) + ) def error_message(self, msg): return json.dumps({"status": "ERROR", "result": msg}) From 8338a69b5022d44537bd0839516dfdf4bf874631 Mon Sep 17 00:00:00 2001 From: Daisuke Baba Date: Fri, 27 Jan 2017 13:09:16 +0900 Subject: [PATCH 2/5] Update copyright --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 064f42a..98a979b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016, CANDY LINE, Inc. +Copyright (c) 2017 CANDY LINE INC. All rights reserved. Redistribution and use in source and binary forms, with or without From 87249d78ca33d0e505f1680d03f439658584c7fb Mon Sep 17 00:00:00 2001 From: Daisuke Baba Date: Fri, 27 Jan 2017 16:42:03 +0900 Subject: [PATCH 3/5] Remove useless debug log --- lib/candy_board_amt/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/candy_board_amt/__init__.py b/lib/candy_board_amt/__init__.py index a42d57b..24e2d26 100644 --- a/lib/candy_board_amt/__init__.py +++ b/lib/candy_board_amt/__init__.py @@ -215,7 +215,6 @@ def run(self): while True: try: connection, client_address = self.sock.accept() - print("Accepted from [%s]" % client_address) connection.setblocking(0) # request From def8c633d2f4480c64ef1460be17dc9c306061b3 Mon Sep 17 00:00:00 2001 From: Daisuke Baba Date: Fri, 27 Jan 2017 16:44:28 +0900 Subject: [PATCH 4/5] Bump up version --- README.md | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44694e6..4e4d4b0 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,10 @@ $ ./setup.py test ``` # Revision history +* 1.2.1 + - Handle uncaught exception + - Suppress useless log + * 1.2.0 - Improve serial port resolver function - Add a new feature to ensure the opened port is online on creating a new serial port object diff --git a/setup.py b/setup.py index d99a1dd..8fcb0fd 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand -version = "1.2.0" +version = "1.2.1" try: import pypandoc From b6291d3545a4835d47faab2f367f5b6ceae3e1ac Mon Sep 17 00:00:00 2001 From: Daisuke Baba Date: Fri, 27 Jan 2017 17:20:29 +0900 Subject: [PATCH 5/5] Use twine for publishing the package --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8fcb0fd..6190def 100755 --- a/setup.py +++ b/setup.py @@ -27,8 +27,9 @@ def run_tests(self): sys.exit(errno) if sys.argv[-1] == 'publish': - os.system('python setup.py sdist upload') - os.system('python setup.py bdist_wheel upload') + os.system('rm -fr dist/*') + os.system('python setup.py sdist') + os.system('twine upload dist/*') sys.exit() setup(