From 5ad952a74aaf5134e237bf4cf499ed1d48d3052d Mon Sep 17 00:00:00 2001
From: "Olivier J.N. Bertrand" <olivier.bertrand@uni-bielefeld.de>
Date: Thu, 20 Sep 2018 09:44:55 +0200
Subject: [PATCH] elif statment was not properly indented and would have lead
 to error in the array rendering mode

---
 navipy/database/__init__.py |  1 +
 navipy/sensors/renderer.py  | 14 +++++++-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/navipy/database/__init__.py b/navipy/database/__init__.py
index 36970e8..f7a84ab 100644
--- a/navipy/database/__init__.py
+++ b/navipy/database/__init__.py
@@ -734,6 +734,7 @@ class DataBase():
         questionsmarks = '?'
         for _ in range(1, len(params_list)):
             questionsmarks += ',?'
+        self._logger.info('Insert image')
         self.db_cursor.execute(
             """
             INSERT OR REPLACE
diff --git a/navipy/sensors/renderer.py b/navipy/sensors/renderer.py
index 7f8b795..7098261 100644
--- a/navipy/sensors/renderer.py
+++ b/navipy/sensors/renderer.py
@@ -102,13 +102,13 @@ class AbstractRender():
                     msg = msg.format(frame_i, rowid)
                     self._logger.warning(msg)
                     continue
-                elif mode == 'array':
-                    filename = fileformat.format(frame_i)
-                    if os.path.exists(filename):
-                        msg = 'frame_i: {} already exist'
-                        msg = msg.format(frame_i)
-                        self._logger.warning(msg)
-                        continue
+            elif mode == 'array':
+                filename = fileformat.format(frame_i)
+                if os.path.exists(filename):
+                    msg = 'frame_i: {} already exist'
+                    msg = msg.format(frame_i)
+                    self._logger.warning(msg)
+                    continue
             # The position-orientatios is valid (none nan)
             # and the cmaxminrange has not already been assigned
             # so the image need to be rendered
-- 
GitLab