mirror of https://gitlab.com/bashrc2/epicyon
Rename rather than copy
parent
8ce4407473
commit
4b645ed1b9
6
media.py
6
media.py
|
@ -141,11 +141,13 @@ def _convertImageToLowBandwidth(imageFilename: str) -> None:
|
||||||
print('WARN: timed out waiting for low bandwidth image conversion')
|
print('WARN: timed out waiting for low bandwidth image conversion')
|
||||||
break
|
break
|
||||||
if os.path.isfile(lowBandwidthFilename):
|
if os.path.isfile(lowBandwidthFilename):
|
||||||
copyfile(lowBandwidthFilename, imageFilename)
|
|
||||||
try:
|
try:
|
||||||
os.remove(lowBandwidthFilename)
|
os.remove(imageFilename)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
pass
|
pass
|
||||||
|
os.rename(lowBandwidthFilename, imageFilename)
|
||||||
|
if os.path.isfile(imageFilename):
|
||||||
|
print('Image converted to low bandwidth ' + imageFilename)
|
||||||
else:
|
else:
|
||||||
print('Low bandwidth converted image not found: ' +
|
print('Low bandwidth converted image not found: ' +
|
||||||
lowBandwidthFilename)
|
lowBandwidthFilename)
|
||||||
|
|
Loading…
Reference in New Issue