Commit e0382a102f5355a1ed76587d9ba110199e676c14

Authored by tatiana
1 parent 44c3f4fa

FIX: Error while creating surface under darwin

Showing 1 changed file with 10 additions and 6 deletions   Show diff stats
invesalius/data/surface.py
... ... @@ -272,7 +272,7 @@ class SurfaceManager():
272 272 Create surface actor, save into project and send it to viewer.
273 273 """
274 274 imagedata, colour, [min_value, max_value], edited_points = pubsub_evt.data
275   - quality='Optimal'
  275 + quality=_('Optimal *')
276 276 mode = 'CONTOUR' # 'GRAYSCALE'
277 277  
278 278 imagedata_tmp = None
... ... @@ -359,13 +359,17 @@ class SurfaceManager():
359 359 # Set actor colour and transparency
360 360 actor.GetProperty().SetColor(colour)
361 361 actor.GetProperty().SetOpacity(1-surface.transparency)
362   -
363   - try:
364   - #Remove all temp file
  362 +
  363 + # Remove temporary files
  364 + if sys.platform == "win32":
  365 + try:
  366 + os.remove(filename_img)
  367 + os.remove(filename_polydata)
  368 + except (WindowsError):
  369 + print "Error while removing surface temporary file"
  370 + else:
365 371 os.remove(filename_img)
366 372 os.remove(filename_polydata)
367   - except(WindowsError):
368   - print "Error remove temp file"
369 373  
370 374 # Append surface into Project.surface_dict
371 375 proj = prj.Project()
... ...