Skip to content

Commit

Permalink
Merge pull request ome#6 from will-moore/make_movie_spaces_9685
Browse files Browse the repository at this point in the history
Replace ' ' with '_' in exported movie name. See #9685
  • Loading branch information
joshmoore committed Oct 12, 2012
2 parents 439ad58 + 465f6ca commit 8f3bd58
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion omero/export_scripts/Make_Movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import omero.util.figureUtil as figUtil
import omero
import omero.min # Constants etc.
import getopt, sys, os, subprocess
import getopt, sys, os, subprocess, re
import numpy
import omero.util.pixelstypetopython as pixelstypetopython
from struct import *
Expand Down Expand Up @@ -541,13 +541,17 @@ def writeMovie(commandArgs, conn):
if not movieName.endswith(".%s" % ext):
movieName = "%s.%s" % (movieName, ext)

movieName = re.sub("[$&\;|\(\)<>' ]","",movieName) # spaces etc in file name cause problems
framesPerSec = 2
if "FPS" in commandArgs:
framesPerSec = commandArgs["FPS"]
buildAVI(mw, mh, filelist, framesPerSec, movieName, format)
figLegend = "\n".join(logLines)
mimetype = formatMimetypes[format]

if not os.path.exists(movieName):
print "mencoder Failed to create movie file: %s" % movieName
return None, "Failed to create movie file: %s" % movieName
if not commandArgs["Do_Link"]:
originalFile = scriptUtil.createFile(updateService, movieName, mimetype, movieName);
scriptUtil.uploadFile(rawFileStore, originalFile, movieName)
Expand Down

0 comments on commit 8f3bd58

Please sign in to comment.