From fae5b672063dc42003378fdcc6ad8b7f1c6ebe16 Mon Sep 17 00:00:00 2001 From: Stepan Bahnik Date: Thu, 12 Mar 2015 23:34:04 +0100 Subject: [PATCH] minor bug corrected in images --- .gitignore | 1 + Stuff/Modules/cm.py | 8 +++----- Stuff/Modules/image.py | 17 ++++++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index b21e24c..2043415 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.files Data Images +Logs # files made by running # ######################### diff --git a/Stuff/Modules/cm.py b/Stuff/Modules/cm.py index 67e2f0e..0aedfae 100644 --- a/Stuff/Modules/cm.py +++ b/Stuff/Modules/cm.py @@ -1045,11 +1045,9 @@ def recognizeStrategy(self, i0, i1, minSpeed, percentSize): x0, y0 = self.data[i0][self.indices] x1, y1 = self.data[i1][self.indices] t0, t1 = self.data[i0][1], self.data[i1][1] - try: - speed = (sqrt(((x1 - x0)**2 + (y1 - y0)**2)) / self.trackerResolution) / ((t1 - t0) / 1000) - except Exception: - print(self.data[i0]) - print(self.data[i1]) + + speed = (sqrt(((x1 - x0)**2 + (y1 - y0)**2)) / self.trackerResolution) / ((t1 - t0) / 1000) + if speed > minSpeed: border = self.radius * (1 - (percentSize / 100)) cx, cy = self.centerX, self.centerY diff --git a/Stuff/Modules/image.py b/Stuff/Modules/image.py index 2b515c1..5315d56 100644 --- a/Stuff/Modules/image.py +++ b/Stuff/Modules/image.py @@ -117,11 +117,14 @@ def okFun(self): elif option[1][2] != "str": value = eval(value) else: - value.replace('"', "'") - if not value.endswith("'"): - value += "'" - if not value.startswith("'"): - value = "'" + value + if not value: + value = "" + else: + value.replace('"', "'") + if not value.endswith("'"): + value += "'" + if not value.startswith("'"): + value = "'" + value optionWrite(option[1][0], value) self.destroy() @@ -199,9 +202,9 @@ def addComponents(self): self.components.append("xticks") if self.yticks and "graph" in self.components: self.components.append("yticks") - if self.xlab and "graph" in self.components: + if self.xlab.strip() and "graph" in self.components: self.components.append("xlab") - if self.ylab and "graph" in self.components: + if self.ylab.strip() and "graph" in self.components: self.components.append("ylab")