Philipp Hörist pushed to branch master at gajim / gajim
Commits: 31a50024 by Philipp Hörist at 2018-09-18T14:03:35Z Fix unneeded-not pylint errors
- - - - - 6b548631 by Philipp Hörist at 2018-09-18T14:28:33Z Dont move window between virtual desktops
Its the job of the window manager to restore a window to the correct location
- - - - - c3e897bd by Philipp Hörist at 2018-09-18T14:29:26Z Fix pylint errors
- used-before-assignment - misplaced-bare-raise
- - - - - c2828231 by Philipp Hörist at 2018-09-18T14:32:31Z Update pylint error list
- Check for E0601 used-before-assignment - Check for E0704 misplaced-bare-raise - Check for W0101 unreachable
- - - - -
7 changed files:
- .gitlab-ci.yml - gajim/gtkgui_helpers.py - gajim/gui_interface.py - gajim/history_manager.py - gajim/plugins/gui.py - gajim/statusicon.py - scripts/dev/pre-push-tests.sh
Changes:
===================================== .gitlab-ci.yml ===================================== --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ run-mypy: run-pylint: stage: test script: - - pylint3 --jobs=2 --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0601,E0611,E0704,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0101,W0104,W0105,W0108,W0109,W0123,W0143,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614,W0631,W0640,W1401,W1505 gajim + - pylint3 --jobs=2 --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0104,W0105,W0108,W0109,W0123,W0143,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614,W0631,W0640,W1401,W1505 gajim
run-build: stage: build
===================================== gajim/gtkgui_helpers.py ===================================== --- a/gajim/gtkgui_helpers.py +++ b/gajim/gtkgui_helpers.py @@ -316,39 +316,6 @@ def get_current_desktop(window): current_virtual_desktop_no = prop[2][0] return current_virtual_desktop_no
-def possibly_move_window_in_current_desktop(window): - """ - Moves GTK window to current virtual desktop if it is not in the current - virtual desktop - - NOTE: Window is a GDK window. - """ - #TODO: property_get doesn't work: - #prop_atom = Gdk.Atom.intern('_NET_CURRENT_DESKTOP', False) - #type_atom = Gdk.Atom.intern("CARDINAL", False) - #w = Gdk.Screen.get_default().get_root_window() - #Gdk.property_get(w, prop_atom, type_atom, 0, 9999, False) - return False - if os.name == 'nt': - return False - - root_window = Gdk.Screen.get_default().get_root_window() - # current user's vd - current_virtual_desktop_no = get_current_desktop(root_window) - - # vd roster window is in - window_virtual_desktop = get_current_desktop(window.window) - - # if one of those is None, something went wrong and we cannot know - # VD info, just hide it (default action) and not show it afterwards - if None not in (window_virtual_desktop, current_virtual_desktop_no): - if current_virtual_desktop_no != window_virtual_desktop: - # we are in another VD that the window was - # so show it in current VD - window.present() - return True - return False - def file_is_locked(path_to_file): """ Return True if file is locked
===================================== gajim/gui_interface.py ===================================== --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -2203,9 +2203,9 @@ class Interface: app.config.get_per('accounts', a, 'last_status_msg'))) continue show = app.config.get_per('accounts', a, 'autoconnect_as') - if not show in app.SHOW_LIST: + if show not in app.SHOW_LIST: continue - if not show in shows: + if show not in shows: shows[show] = [a] else: shows[show].append(a)
===================================== gajim/history_manager.py ===================================== --- a/gajim/history_manager.py +++ b/gajim/history_manager.py @@ -45,6 +45,7 @@ from gi.repository import Gio from gajim.common import app from gajim.common import i18n from gajim.common import configpaths +from gajim.common.i18n import _ from gajim.common.const import StyleAttr
def is_standalone(): @@ -80,7 +81,6 @@ if is_standalone(): configpaths.init() app.load_css_config()
-from gajim.common.i18n import _ from gajim.common.const import JIDConstant, KindConstant from gajim.common import helpers from gajim.gtk import YesNoDialog @@ -346,12 +346,7 @@ class HistoryManager: """ self.cur.execute('SELECT type FROM jids WHERE jid = ?', (jid,)) row = self.cur.fetchone() - if row is None: - raise - elif row[0] == JIDConstant.ROOM_TYPE: - return True - else: # normal type - return False + return row[0] == JIDConstant.ROOM_TYPE
def _fill_logs_listview(self, jid): """
===================================== gajim/plugins/gui.py ===================================== --- a/gajim/plugins/gui.py +++ b/gajim/plugins/gui.py @@ -114,7 +114,6 @@ class PluginsWindow: app.plugin_manager.gui_extension_point('plugin_window', self)
self.window.show_all() - gtkgui_helpers.possibly_move_window_in_current_desktop(self.window)
def on_key_press_event(self, widget, event): if event.keyval == Gdk.KEY_Escape:
===================================== gajim/statusicon.py ===================================== --- a/gajim/statusicon.py +++ b/gajim/statusicon.py @@ -368,17 +368,12 @@ class StatusIcon: win = app.interface.roster.window if not app.events.get_systray_events(): # No pending events, so toggle visible/hidden for roster window - if win.get_property('visible') and (win.get_property( - 'has-toplevel-focus') or os.name == 'nt'): - # visible in ANY virtual desktop? - - # we could be in another VD right now. eg vd2 - # and we want to show it in vd2 - if not gtkgui_helpers.possibly_move_window_in_current_desktop( - win) and app.config.get('save-roster-position'): - x, y = win.get_position() - app.config.set('roster_x-position', x) - app.config.set('roster_y-position', y) + if win.get_property('visible'): + if win.get_property('has-toplevel-focus') or os.name == 'nt': + if app.config.get('save-roster-position'): + x, y = win.get_position() + app.config.set('roster_x-position', x) + app.config.set('roster_y-position', y) win.hide() # else we hide it from VD that was visible in else: if not win.get_property('visible'):
===================================== scripts/dev/pre-push-tests.sh ===================================== --- a/scripts/dev/pre-push-tests.sh +++ b/scripts/dev/pre-push-tests.sh @@ -1,2 +1,15 @@ mypy -p gajim.common.modules --follow-imports=skip -pylint --jobs=2 --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0601,E0611,E0704,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0101,W0104,W0105,W0108,W0109,W0123,W0143,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614,W0631,W0640,W1401,W1505 gajim \ No newline at end of file +pylint --jobs=2 --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,R1706,R1711,R1716,W0104,W0105,W0108,W0109,W0123,W0143,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614,W0631,W0640,W1401,W1505 gajim + +# C0103 invalid-name +# C0302 too-many-lines +# C0330 bad-continuation +# C0411 wrong-import-order +# C0412 ungrouped-imports +# C0413 wrong-import-position +# E0203 access-member-before-definition +# E0401 import-error +# E0611 no-name-in-module +# E0710 raising-non-exception - GLIB +# E0712 catching-non-exception - GLIB +# R0201 no-self-use \ No newline at end of file
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/8fad65ccbf6fcc73cd55be45634dead9b3...