diff --git a/command_line.py b/command_line.py index 6ef30cc..d22e140 100644 --- a/command_line.py +++ b/command_line.py @@ -140,8 +140,6 @@ class Setting(object): new_bytes = file.read(extract_path) except KeyError as e: log(e) - print e - print e if new_bytes is not None: fbytes.append((dest_path, new_bytes)) @@ -599,9 +597,10 @@ class CommandBase(object): if os.path.isabs(f_path): try: shutil.copy(setting.value, self.project_dir()) - setting.value = os.path.basename(setting.value) except shutil.Error as e: # same file warning log('Warning: {}'.format(e)) + finally: + setting.value = os.path.basename(setting.value) os.chdir(old_dir) diff --git a/main.py b/main.py index 0a23a17..7e587da 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ from utils import log, open_folder_in_explorer -__gui_version__ = "v0.1.14b" +__gui_version__ = "v0.1.16b" import os import glob @@ -519,6 +519,7 @@ class MainWindow(QtGui.QWidget, CommandBase): QtCore.QDir.currentPath()), setting.file_types) if file_path: + file_path = os.path.abspath(file_path) # fixes an issue with windows paths file_path = file_path.replace(self.project_dir()+os.path.sep, '') text_obj.setText(file_path) setting.last_value = file_path diff --git a/utils.py b/utils.py index 47bec9e..5ee89e1 100644 --- a/utils.py +++ b/utils.py @@ -20,6 +20,9 @@ def get_temp_dir(): def log(*args): if DEBUG: print(*args) + with open('error.log', 'a+') as f: + f.write(', '.join(args)) + f.write('\n') def open_folder_in_explorer(path): if platform.system() == "Windows":