From fa9166b738b9080c19b9194810a1fbd260f0ce46 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Thu, 1 Jun 2017 19:15:49 -0700 Subject: [PATCH] Fixed post processing output if document is in current working directory. --- src/Mod/Path/PathScripts/PathPost.py | 29 ++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathPost.py b/src/Mod/Path/PathScripts/PathPost.py index 22b418dbe6..dd58bca520 100644 --- a/src/Mod/Path/PathScripts/PathPost.py +++ b/src/Mod/Path/PathScripts/PathPost.py @@ -22,20 +22,26 @@ # * * # *************************************************************************** ''' Post Process command that will make use of the Output File and Post Processor entries in PathJob ''' + from __future__ import print_function + import FreeCAD import FreeCADGui -from PySide import QtCore, QtGui -from PathScripts import PathUtils -from PathScripts import PathJob -from PathScripts import PathLoadTool -from PathScripts.PathPreferences import PathPreferences -from PathScripts.PathPostProcessor import PostProcessor import os import PathScripts.PathLog as PathLog -LOG_MODULE = 'PathPost' + +from PathScripts import PathJob +from PathScripts import PathLoadTool +from PathScripts import PathUtils +from PathScripts.PathPostProcessor import PostProcessor +from PathScripts.PathPreferences import PathPreferences +from PySide import QtCore, QtGui + + +LOG_MODULE = PathLog.thisModule() + PathLog.setLevel(PathLog.Level.DEBUG, LOG_MODULE) -PathLog.trackModule('PathPost') +PathLog.trackModule(LOG_MODULE) # Qt tanslation handling try: @@ -86,13 +92,16 @@ class CommandPathPost: def resolveFileName(self, job): path = PathPreferences.defaultOutputFile() - if job.OutputFile: - path = job.OutputFile + if job.PostProcessorOutputFile: + path = job.PostProcessorOutputFile filename = path if '%D' in filename: D = FreeCAD.ActiveDocument.FileName if D: D = os.path.dirname(D) + # in case the document is in the current working directory + if not D: + D = '.' else: FreeCAD.Console.PrintError("Please save document in order to resolve output path!\n") return None