From 9cb537deed4a484a6c4f8fb8e8e8065c31b4152c Mon Sep 17 00:00:00 2001 From: PerthGoat Date: Sun, 5 May 2024 11:45:06 -0700 Subject: [PATCH] fixed warnings on python3.12 --- __main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__main__.py b/__main__.py index 2ff8e2e..6a1f553 100644 --- a/__main__.py +++ b/__main__.py @@ -431,10 +431,10 @@ def convertToRTF(self, start, finish): imgx, imgy = shifted_img.size #print(imgx, imgy) shifted_img.save(ibytes, 'PNG') - data += r'{\pict\pngblip' + f'\picw{int(imgx*self.rtf_img_factor)}\pich{int(imgy*self.rtf_img_factor)} ' + ibytes.getvalue().hex() + '}' + data += r'{\pict\pngblip' + rf'\picw{int(imgx*self.rtf_img_factor)}\pich{int(imgy*self.rtf_img_factor)} ' + ibytes.getvalue().hex() + '}' elif t[0] == 'text': txt = t[1] - txt = txt.replace('\\', '\\\\').replace('{', '\{').replace('}', '\}').replace('\n', r'{\par }') # escape backslash and curly brace + txt = txt.replace('\\', '\\\\').replace('{', r'\{').replace('}', r'\}').replace('\n', r'{\par }') # escape backslash and curly brace txt = ''.join([fr"\u{ord(c):04d}?" if ord(c) > 0x7F else c for c in txt]) # if non ASCII, then encode the character for RTF data += txt