mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-03 11:21:52 +02:00
[graph] use shutil to rename status file
* os.rename does not work on Windows if destination already exists
This commit is contained in:
parent
0485ce4738
commit
7e1a66663a
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ import hashlib
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import psutil
|
import psutil
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
@ -332,7 +333,7 @@ class Node:
|
||||||
statusFilepathWriting = statusFilepath + '.writing.' + str(uuid.uuid4())
|
statusFilepathWriting = statusFilepath + '.writing.' + str(uuid.uuid4())
|
||||||
with open(statusFilepathWriting, 'w') as jsonFile:
|
with open(statusFilepathWriting, 'w') as jsonFile:
|
||||||
json.dump(data, jsonFile, indent=4)
|
json.dump(data, jsonFile, indent=4)
|
||||||
os.rename(statusFilepathWriting, statusFilepath)
|
shutil.move(statusFilepathWriting, statusFilepath)
|
||||||
|
|
||||||
def upgradeStatusTo(self, newStatus):
|
def upgradeStatusTo(self, newStatus):
|
||||||
if int(newStatus.value) <= int(self.status.status.value):
|
if int(newStatus.value) <= int(self.status.status.value):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue