From 345313121bee58bee28b7f1320b819118a4b2751 Mon Sep 17 00:00:00 2001 From: Mahmoud Younes Date: Sun, 22 Jul 2018 13:42:53 +0200 Subject: [PATCH] fixed compatibility with python 3 errors. made os path sep instead of hard coding path sep (broke on windows) --- alyn/__init__.py | 4 ++-- alyn/deskew.py | 2 +- alyn/skew_detect.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/alyn/__init__.py b/alyn/__init__.py index 1b430f8..01c27a0 100644 --- a/alyn/__init__.py +++ b/alyn/__init__.py @@ -1,3 +1,3 @@ """ Import required modules""" -from deskew import * -from skew_detect import * +from .deskew import * +from .skew_detect import * diff --git a/alyn/deskew.py b/alyn/deskew.py index 029be4f..605b601 100755 --- a/alyn/deskew.py +++ b/alyn/deskew.py @@ -3,7 +3,7 @@ import numpy as np import matplotlib.pyplot as plt -from skew_detect import SkewDetect +from .skew_detect import SkewDetect from skimage import io from skimage.transform import rotate diff --git a/alyn/skew_detect.py b/alyn/skew_detect.py index 2612102..57106ff 100755 --- a/alyn/skew_detect.py +++ b/alyn/skew_detect.py @@ -77,7 +77,7 @@ def compare_sum(self, value): def display(self, data): for i in data: - print i + ": " + str(data[i]) + print(i + ": " + str(data[i])) def calculate_deviation(self, angle): @@ -104,7 +104,7 @@ def run(self): if self.batch_path: self.batch_process() else: - print "Invalid input, nothing to process." + print("Invalid input, nothing to process.") else: self.process_single_file() @@ -113,7 +113,7 @@ def check_path(self, path): if os.path.isabs(path): full_path = path else: - full_path = os.getcwd() + '/' + str(path) + full_path = os.getcwd() + os.path.sep + str(path) return full_path def process_single_file(self):