[Python-modules-commits] [pychromecast] 02/05: Import pychromecast_0.8.1.orig.tar.gz

Ruben Undheim rubund-guest at moszumanska.debian.org
Thu Jul 13 19:58:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

rubund-guest pushed a commit to branch master
in repository pychromecast.

commit 168ae6cdd7c32ad291ce4fd9edb9f00516392f27
Author: Ruben Undheim <ruben.undheim at gmail.com>
Date:   Thu Jul 13 19:26:42 2017 +0000

    Import pychromecast_0.8.1.orig.tar.gz
---
 README.rst                    |  3 +--
 pychromecast/socket_client.py | 22 ++++++++++++----------
 setup.py                      |  2 +-
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/README.rst b/README.rst
index e4ef4cf..ebfc0b6 100644
--- a/README.rst
+++ b/README.rst
@@ -15,8 +15,7 @@ currently supports:
 -  Easily extendable to add support for unsupported namespaces
 -  Multi-room setups with Audio cast devices
 
-*PyChromecast 0.6 introduces some backward incompatible changes due to
-the migration from DIAL to socket for retrieving the app status.*
+*Check out [Home Assistant](https://home-assistant.io) for a ready-made solution using PyChromecast for controlling and automating your Chromecast or Cast-enabled device like Google Home.*
 
 Dependencies
 ------------
diff --git a/pychromecast/socket_client.py b/pychromecast/socket_client.py
index 3a7bf6d..e8324ef 100644
--- a/pychromecast/socket_client.py
+++ b/pychromecast/socket_client.py
@@ -234,7 +234,7 @@ class SocketClient(threading.Thread):
         self._open_channels = []
 
         self.connecting = True
-        retry_log_fun = self.logger.exception
+        retry_log_fun = self.logger.error
 
         while not self.stop.is_set() and (tries is None or tries > 0):
             try:
@@ -255,17 +255,18 @@ class SocketClient(threading.Thread):
 
                 self.logger.debug("Connected!")
                 break
-            except socket.error:
+            except socket.error as err:
                 self.connecting = True
                 if self.stop.is_set():
-                    self.logger.exception(
-                        "Failed to connect, aborting due to stop signal.")
+                    self.logger.error(
+                        "Failed to connect: %s. aborting due to stop signal.",
+                        err)
                     raise ChromecastConnectionError("Failed to connect")
 
                 self._report_connection_status(
                     ConnectionStatus(CONNECTION_STATUS_FAILED,
                                      NetworkAddress(self.host, self.port)))
-                retry_log_fun("Failed to connect, retrying in %fs",
+                retry_log_fun("Failed to connect, retrying in %.1fs",
                               self.retry_wait)
                 retry_log_fun = self.logger.debug
 
@@ -367,8 +368,8 @@ class SocketClient(threading.Thread):
                     self.logger.info(
                         "Stopped while reading message, disconnecting.")
                 else:
-                    self.logger.exception(
-                        "Interruption caught without being stopped %s",
+                    self.logger.error(
+                        "Interruption caught without being stopped: %s",
                         exc)
                 return 1
             except ssl.SSLError as exc:
@@ -378,7 +379,7 @@ class SocketClient(threading.Thread):
                 raise
             except socket.error:
                 self._force_recon = True
-                self.logger.info('Error reading from socket.')
+                self.logger.error('Error reading from socket.')
             else:
                 data = _json_from_message(message)
         if not message:
@@ -701,7 +702,7 @@ class HeartbeatController(BaseController):
                     PLATFORM_DESTINATION_ID, self.namespace,
                     {MESSAGE_TYPE: TYPE_PONG}, no_add_request_id=True)
             except PyChromecastStopped:
-                self._socket_client.logger.exception(
+                self._socket_client.logger.debug(
                     "Heartbeat error when sending response, "
                     "Chromecast connection has stopped")
 
@@ -825,7 +826,8 @@ class ReceiverController(BaseController):
         else:
             self.logger.info(
                 "Not launching app %s - already running", app_id)
-            callback_function()
+            if callback_function:
+                callback_function()
 
     def _block_till_launched(self, app_id):
         if self.blocking:
diff --git a/setup.py b/setup.py
index 484d10d..7304fd9 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ long_description = open('README.rst').read()
 
 setup(
     name='PyChromecast',
-    version='0.8.0',
+    version='0.8.1',
     license='MIT',
     url='https://github.com/balloob/pychromecast',
     author='Paulus Schoutsen',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pychromecast.git



More information about the Python-modules-commits mailing list