From 8ef7685d0f5d7a4d4eaee2130f3ccc949c3c1106 Mon Sep 17 00:00:00 2001 From: "Schimon Jehudah, Adv." Date: Tue, 15 Oct 2024 23:20:51 +0300 Subject: [PATCH] Python: Further fix of consequent errors. --- fasi.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fasi.py b/fasi.py index 8ba0d22..6c309b1 100644 --- a/fasi.py +++ b/fasi.py @@ -319,7 +319,7 @@ class HttpInstance: jid_bare, jid_info, jid_kind, node_name, item_id) # Graphic files - filename, filepath, filetype, selection = FileUtilities.handle_photo(jid_bare, jid_vcard) + filename, filepath, filetype, selection = FileUtilities.handle_photo(jid_bare, jid_vcard, link_href) #except Exception as e: else: @@ -550,7 +550,7 @@ class HttpInstance: jid_bare, jid_info, jid_kind, node_name) # Graphic files - filename, filepath, filetype, selection = FileUtilities.handle_photo(jid_bare, jid_vcard) + filename, filepath, filetype, selection = FileUtilities.handle_photo(jid_bare, jid_vcard, link_href) #except Exception as e: else: @@ -835,15 +835,14 @@ class FileUtilities: return jid_details def handle_photo(jid_bare, jid_vcard, link_href): - filetype = selection = None + filename = filepath = filetype = mimetype = selection = None filecirca = 'photo/{}.*'.format(jid_bare) filepath_guess = glob.glob(filecirca) if filepath_guess: - filepath_guess = filepath_guess[0] - filetype = filepath_guess.split('.').pop() + filepath = filepath_guess[0] + filetype = filepath.split('.').pop() filename = '{}.{}'.format(jid_bare, filetype) elif jid_vcard: - mimetype = filename = filepath = None if jid_vcard['type']: mimetype = jid_vcard['type'] if mimetype: