Skip to content

Commit

Permalink
Make nicer temp filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
rpavlik committed Jan 11, 2010
1 parent 286a39b commit d91f498
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmake-bulk-decrufter.py
Expand Up @@ -196,10 +196,11 @@ def runMergeTool(self, filename, formatted):
if originalscript == formatted:
return

t1 = subprocess.Popen(["mktemp", "/tmp/Decrufted.XXXXXXXXXX"], stdout=subprocess.PIPE)
tempclean = t1.communicate()[0]
t2 = subprocess.Popen(["mktemp", "/tmp/Original.XXXXXXXXXX"], stdout=subprocess.PIPE)
temporig = t2.communicate()[0]
modname = os.path.splitext(os.path.basename(filename))[0]
t1 = subprocess.Popen(["mktemp", "/tmp/"+modname+"Decrufted.XXXXXX.cmake"], stdout=subprocess.PIPE)
tempclean = t1.communicate()[0].strip()
t2 = subprocess.Popen(["mktemp", "/tmp/"+modname+"Original.XXXXXX.cmake"], stdout=subprocess.PIPE)
temporig = t2.communicate()[0].strip()

temporigfile = open(temporig, 'w', False)
temporigfile.write(originalscript)
Expand Down

0 comments on commit d91f498

Please sign in to comment.