From 48efb5a44e5d4c2b1a79dfe85e8465c264515989 Mon Sep 17 00:00:00 2001 From: emdee Date: Sun, 10 Dec 2023 18:20:04 +0000 Subject: [PATCH] bugfix --- toxygen/.pylint.sh | 9 +++++++++ toxygen/contacts/contact.py | 2 +- toxygen/ui/main_screen.py | 12 ++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/toxygen/.pylint.sh b/toxygen/.pylint.sh index 4fc3a3f..c2e645c 100755 --- a/toxygen/.pylint.sh +++ b/toxygen/.pylint.sh @@ -3,3 +3,12 @@ ROLE=logging /var/local/bin/pydev_pylint.bash -E -f text *py [a-nr-z]*/*py >.pylint.err /var/local/bin/pydev_pylint.bash *py [a-nr-z]*/*py >.pylint.out + +sed -e "/Module 'os' has no/d" \ + -e "/Undefined variable 'app'/d" \ + -e '/tests\//d' \ + -e "/Instance of 'Curl' has no /d" \ + -e "/No name 'path' in module 'os' /d" \ + -e "/ in module 'os'/d" \ + -e "/.bak\//d" \ + -i .pylint.err .pylint.out diff --git a/toxygen/contacts/contact.py b/toxygen/contacts/contact.py index 5e9af69..d034702 100644 --- a/toxygen/contacts/contact.py +++ b/toxygen/contacts/contact.py @@ -134,7 +134,7 @@ class Contact(basecontact.BaseContact): """ # and m.tox_message_id == tox_message_id, messages = filter(lambda m: m.author is not None - and m.author.type == MESSAGE_AUTHOR['NOT_SENT'] + and m.author.type == MESSAGE_AUTHOR['NOT_SENT'], self._corr) # was message = list(...)[0] return list(messages) diff --git a/toxygen/ui/main_screen.py b/toxygen/ui/main_screen.py index 8bcd39a..53db77b 100644 --- a/toxygen/ui/main_screen.py +++ b/toxygen/ui/main_screen.py @@ -684,17 +684,17 @@ class MainWindow(QtWidgets.QMainWindow): font_width = QFontMetrics(font).width('M') self._pe.setFont(font) geometry = self._pe.geometry() - geometry.setWidth(font_width*50+20) - geometry.setHeight(font_width*24*13/8) + geometry.setWidth(int(font_width*50+20)) + geometry.setHeight(int(font_width*24*13/8)) self._pe.setGeometry(geometry) - self._pe.resize(font_width*50+20, font_width*24*13/8) + self._pe.resize(int(font_width*50+20), int(font_width*24*13/8)) self._pe.show() self._pe.eval_queued() # or self._pe.eval_in_thread() return except Exception as e: - LOG.debug(e) + LOG.warn(f"python_console EXCEPTION {e}") def weechat_console(self): if self._we: @@ -748,11 +748,11 @@ class MainWindow(QtWidgets.QMainWindow): # LOG.debug(e) font_width = size geometry = self._we.geometry() - geometry.setWidth(font_width*80+20) + geometry.setWidth(int(font_width*80+20)) geometry.setHeight(int(font_width*(2+24)*11/8)) self._we.setGeometry(geometry) #? QtCore.QSize() - self._we.resize(font_width*80+20, int(font_width*(2+24)*11/8)) + self._we.resize(int(font_width*80+20), int(font_width*(2+24)*11/8)) self._we.list_buffers.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)