mirror of https://gitlab.com/bashrc2/epicyon
Check file size before and after move
parent
e414a3bd5e
commit
e0587056e9
|
|
@ -7,6 +7,7 @@ __email__ = "bob@libreserver.org"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
__module_group__ = "Timeline"
|
__module_group__ = "Timeline"
|
||||||
|
|
||||||
|
import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from auth import create_password
|
from auth import create_password
|
||||||
from posts import is_image_media
|
from posts import is_image_media
|
||||||
|
|
@ -505,9 +506,16 @@ def post_message_to_outbox(session, translate: {},
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: rename image upload ' +
|
print('DEBUG: rename image upload ' +
|
||||||
upload_media_filename + ' -> ' + media_filename)
|
upload_media_filename + ' -> ' + media_filename)
|
||||||
|
file_size: int = os.path.getsize(upload_media_filename)
|
||||||
|
print('DEBUG: rename image upload file size 1 ' +
|
||||||
|
str(file_size) + ' bytes')
|
||||||
move_file(upload_media_filename, media_filename,
|
move_file(upload_media_filename, media_filename,
|
||||||
'EX: post_message_to_outbox unable to rename ' +
|
'EX: post_message_to_outbox unable to rename ' +
|
||||||
upload_media_filename + ' -> ' + media_filename)
|
upload_media_filename + ' -> ' + media_filename)
|
||||||
|
if debug:
|
||||||
|
file_size: int = os.path.getsize(media_filename)
|
||||||
|
print('DEBUG: rename image upload file size 2 ' +
|
||||||
|
str(file_size) + ' bytes')
|
||||||
# convert dictionary to list if needed
|
# convert dictionary to list if needed
|
||||||
if isinstance(message_json['object']['attachment'], dict):
|
if isinstance(message_json['object']['attachment'], dict):
|
||||||
message_json['object']['attachment'] = \
|
message_json['object']['attachment'] = \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue