Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaid <daid303@gmail.com>2015-02-13 09:14:06 +0300
committerdaid <daid303@gmail.com>2015-02-13 09:14:06 +0300
commita5b74cd77d54bc67620dc84b6db6304bdbad6b21 (patch)
tree8b0250b6e3f4eaca62fc6a1460266701c9d4a8a9
parentf9c3f872cc3b0bf736bd7461a443a696c30bf654 (diff)
Handle exceptions in the SD replication code.
-rw-r--r--Cura/gui/sceneView.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py
index 9547dd0b27..00296a19cf 100644
--- a/Cura/gui/sceneView.py
+++ b/Cura/gui/sceneView.py
@@ -276,15 +276,19 @@ class SceneView(openglGui.glGuiPanel):
#check if the file is part of the root folder. If so, create folders on sd card to get the same folder hierarchy.
repDir = profile.getPreference("sdcard_rootfolder")
- if os.path.exists(repDir) and os.path.isdir(repDir):
- repDir = os.path.abspath(repDir)
- originFilename = os.path.abspath( self._scene._objectList[0].getOriginFilename() )
- if os.path.dirname(originFilename).startswith(repDir):
- filename = os.path.splitext(originFilename[len(repDir):])[0] + profile.getGCodeExtension()
- sdPath = os.path.dirname(os.path.join( drive[1], filename))
- if not os.path.exists(sdPath):
- print "Creating replication directory:", sdPath
- os.makedirs(sdPath)
+ try:
+ if os.path.exists(repDir) and os.path.isdir(repDir):
+ repDir = os.path.abspath(repDir)
+ originFilename = os.path.abspath( self._scene._objectList[0].getOriginFilename() )
+ if os.path.dirname(originFilename).startswith(repDir):
+ new_filename = os.path.splitext(originFilename[len(repDir):])[0] + profile.getGCodeExtension()
+ sdPath = os.path.dirname(os.path.join(drive[1], new_filename))
+ if not os.path.exists(sdPath):
+ print "Creating replication directory:", sdPath
+ os.makedirs(sdPath)
+ filename = new_filename
+ except:
+ pass
threading.Thread(target=self._saveGCode,args=(drive[1] + filename, drive[1])).start()
elif connectionGroup is not None: