From 56abcf4a02a0a9453c9d3aaf1aafd70f4151069a Mon Sep 17 00:00:00 2001
From: inso <insomniak.fr@gmaiL.com>
Date: Sun, 3 Apr 2016 19:36:22 +0200
Subject: [PATCH] Build with QtWebKitWidgets

---
 ci/travis/before_install.sh   | 4 +++-
 src/sakia/core/account.py     | 3 +++
 src/sakia/core/config.py      | 2 +-
 src/sakia/core/net/network.py | 2 ++
 src/sakia/main.py             | 4 ++++
 5 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ci/travis/before_install.sh b/ci/travis/before_install.sh
index ba2085b4..e8334660 100755
--- a/ci/travis/before_install.sh
+++ b/ci/travis/before_install.sh
@@ -61,7 +61,8 @@ then
             --enable QtCore \
             --enable QtWidgets \
             --enable QtGui \
-            --enable QtSvg\
+            --enable QtSvg \
+            --enable QtWebKitWidgets \
             --enable QtTest
     elif [ $TRAVIS_OS_NAME == "linux" ]
     then
@@ -70,6 +71,7 @@ then
             --enable QtWidgets \
             --enable QtGui \
             --enable QtSvg\
+            --enable QtWebKitWidgets \
             --enable QtTest
     fi
 
diff --git a/src/sakia/core/account.py b/src/sakia/core/account.py
index fc7f7c75..8081ff9a 100644
--- a/src/sakia/core/account.py
+++ b/src/sakia/core/account.py
@@ -575,11 +575,14 @@ class Account(QObject):
             c.start_coroutines()
 
     async def stop_coroutines(self):
+        logging.debug("Stop communities coroutines")
         for c in self.communities:
             await c.stop_coroutines()
 
+        logging.debug("Stop wallets coroutines")
         for w in self.wallets:
             w.stop_coroutines()
+        logging.debug("Account coroutines stopped")
 
     def jsonify(self):
         """
diff --git a/src/sakia/core/config.py b/src/sakia/core/config.py
index 50a9ecc0..278d0be8 100644
--- a/src/sakia/core/config.py
+++ b/src/sakia/core/config.py
@@ -49,6 +49,6 @@ def parse_arguments(argv):
             level=logging.INFO)
     else:
         logging.getLogger().propagate = False
-    logging.getLogger('quamash').setLevel(logging.INFO)
+    logging.getLogger('quamash').setLevel(logging.DEBUG)
     logfile = FileHandler(path.join(parameters['home'], 'sakia.log'))
     logging.getLogger().addHandler(logfile)
diff --git a/src/sakia/core/net/network.py b/src/sakia/core/net/network.py
index ca0ebeed..e02f01e5 100644
--- a/src/sakia/core/net/network.py
+++ b/src/sakia/core/net/network.py
@@ -147,10 +147,12 @@ class Network(QObject):
         """
         self._must_crawl = False
         close_tasks = []
+        logging.debug("Start closing")
         for node in self.nodes:
             close_tasks.append(asyncio.ensure_future(node.close_ws()))
         if len(close_tasks) > 0:
             await asyncio.wait(close_tasks, timeout=15)
+        logging.debug("Closing client session")
         await self._client_session.close()
         logging.debug("Closed")
 
diff --git a/src/sakia/main.py b/src/sakia/main.py
index 071eb66b..fba48d1e 100755
--- a/src/sakia/main.py
+++ b/src/sakia/main.py
@@ -72,6 +72,10 @@ if __name__ == '__main__':
         loop.run_forever()
         try:
             loop.run_until_complete(app.stop())
+            logging.debug("Application stopped")
         except asyncio.CancelledError:
             logging.info('CancelledError')
+    logging.debug("Exiting")
     sys.exit()
+    logging.debug("Application stopped")
+
-- 
GitLab