Philipp Hörist pushed to branch master at gajim / gajim
Commits:
c7c74998 by André Apitzsch at 2018-09-18T20:23:58Z
Remote control: Better handle unknown types
there is no corresponding GLib.Variant for None,
use conversion to string as workaround
- - - - -
1 changed file:
- gajim/remote_control.py
Changes:
=====================================
gajim/remote_control.py
=====================================
--- a/gajim/remote_control.py
+++ b/gajim/remote_control.py
@@ -62,7 +62,7 @@ def get_dbus_struct(obj):
result.insert_value(key, get_dbus_struct(value))
return result.end()
# unknown type
- return None
+ return GLib.Variant('s', str(obj))
class Server:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/c7c74998f23dae88479e46bd02ce8ee677…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/c7c74998f23dae88479e46bd02ce8ee677…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
6c80473e by Philipp Hörist at 2018-09-18T15:39:35Z
pylint W0143 is not available on pylint < 2.0
- - - - -
2 changed files:
- gajim/common/connection.py
- gajim/gui_menu_builder.py
Changes:
=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -1031,7 +1031,7 @@ class Connection(CommonConnection, ConnectionHandlers):
nbxmpp.dispatcher_nb.DEFAULT_TIMEOUT_SECONDS = \
self.try_connecting_for_foo_secs
# FIXME: this is a hack; need a better way
- if self.on_connect_success == self._on_new_account: # pylint: disable=W0143
+ if self.on_connect_success == self._on_new_account:
con.RegisterDisconnectHandler(self._on_new_account)
if self.client_cert and app.config.get_per('accounts', self.name,
=====================================
gajim/gui_menu_builder.py
=====================================
--- a/gajim/gui_menu_builder.py
+++ b/gajim/gui_menu_builder.py
@@ -41,7 +41,6 @@ def build_resources_submenu(contacts, account, action, room_jid=None,
item = Gtk.MenuItem.new_with_label(
'%s (%s)' % (c.resource, str(c.priority)))
sub_menu.append(item)
- # pylint: disable=W0143
if action == roster.on_invite_to_room:
item.connect('activate', action, [(c, account)], room_jid,
room_account, c.resource)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/6c80473ebe645e38c38b10a3d67d008f27…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/6c80473ebe645e38c38b10a3d67d008f27…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
81387ada by Philipp Hörist at 2018-09-18T14:44:23Z
Fix pylint errors
- pointless-statement
- pointless-string-statement
- unnecessary-lambda
- - - - -
457faf38 by Philipp Hörist at 2018-09-18T14:46:20Z
Update pylint error list
- Check for W0104 pointless-statement
- Check for W0105 pointless-string-statement
- Check for W0108 unnecessary-lambda
- - - - -
6 changed files:
- .gitlab-ci.yml
- gajim/common/app.py
- gajim/filetransfers_window.py
- gajim/gtk/profile.py
- gajim/gui_menu_builder.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,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
+ - 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,W0109,W0123,W0143,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614,W0631,W0640,W1401,W1505 gajim
run-build:
stage: build
=====================================
gajim/common/app.py
=====================================
--- a/gajim/common/app.py
+++ b/gajim/common/app.py
@@ -188,14 +188,12 @@ def detect_dependencies():
# python-gnupg
try:
import gnupg
- '''
- We need https://pypi.python.org/pypi/python-gnupg
- but https://pypi.python.org/pypi/gnupg shares the same package name.
- It cannot be used as a drop-in replacement.
- We test with a version check if python-gnupg is installed as it is
- on a much lower version number than gnupg
- Also we need at least python-gnupg 0.3.8
- '''
+ # We need https://pypi.python.org/pypi/python-gnupg
+ # but https://pypi.python.org/pypi/gnupg shares the same package name.
+ # It cannot be used as a drop-in replacement.
+ # We test with a version check if python-gnupg is installed as it is
+ # on a much lower version number than gnupg
+ # Also we need at least python-gnupg 0.3.8
v_gnupg = gnupg.__version__
if V(v_gnupg) < V('0.3.8') or V(v_gnupg) > V('1.0.0'):
log('gajim').info('Gajim needs python-gnupg >= 0.3.8')
=====================================
gajim/filetransfers_window.py
=====================================
--- a/gajim/filetransfers_window.py
+++ b/gajim/filetransfers_window.py
@@ -466,7 +466,7 @@ class FileTransfersWindow:
iter_ = self.get_iter_by_sid(file_props.type_, file_props.sid)
if iter_ is None:
return
- self.model[iter_][Column.SID]
+
if status == 'stop':
file_props.stopped = True
elif status == 'ok':
=====================================
gajim/gtk/profile.py
=====================================
--- a/gajim/gtk/profile.py
+++ b/gajim/gtk/profile.py
@@ -185,7 +185,7 @@ class ProfileWindow(Gtk.ApplicationWindow):
pritext,
_('Format of the date must be YYYY-MM-DD'),
transient_for=self)
- GLib.idle_add(lambda: widget.grab_focus())
+ GLib.idle_add(widget.grab_focus)
return True
def set_value(self, entry_name, value):
=====================================
gajim/gui_menu_builder.py
=====================================
--- a/gajim/gui_menu_builder.py
+++ b/gajim/gui_menu_builder.py
@@ -594,10 +594,6 @@ def get_transport_menu(contact, account):
menu.show_all()
return menu
-'''
-Build dynamic Application Menus
-'''
-
def get_singlechat_menu(control_id):
singlechat_menu = [
=====================================
scripts/dev/pre-push-tests.sh
=====================================
--- a/scripts/dev/pre-push-tests.sh
+++ b/scripts/dev/pre-push-tests.sh
@@ -1,5 +1,5 @@
mypy -p gajim.common.modules --follow-imports=skip
-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
+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,W0109,W0123,W0143,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614,W0631,W0640,W1401,W1505 gajim
# C0103 invalid-name
# C0302 too-many-lines
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/c2828231bd217d59039b98676415d2e82…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/c2828231bd217d59039b98676415d2e82…
You're receiving this email because of your account on dev.gajim.org.
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/8fad65ccbf6fcc73cd55be45634dead9b…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/8fad65ccbf6fcc73cd55be45634dead9b…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
251dbae5 by Philipp Hörist at 2018-09-18T12:46:35Z
Update pylint error list
Specify from now on the errors that are disabled instead of enabled,
because we have now more checks enabled than disabled
- - - - -
2 changed files:
- .gitlab-ci.yml
- 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 --additional-builtins=_ --disable=all --enable=C0121,C0201,C0303,C0321,C0325,C0326,C1801,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0106,E0107,E0108,E0202,E0221,E0222,E0235,E0501,E0502,E0503,E0602,E0603,E0604,E0701,E0702,E1001,E1002,E1003,E1004,E1111,E1120,E1121,E1122,E1123,E1124,E1125,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701,R0123,R0205,R1703,R1704,R1705,R1707,R1714,W0102,W0107,W0235,W0611,W0612,W0621,W0622,W0702,W1201,W1202 gajim
+ - pylint3 --jobs=2 --disable=C0103,C0113,C0123,C0200,C0203,C0302,C0305,C0330,C0411,C0412,C0413,E0203,E0213,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
run-build:
stage: build
=====================================
scripts/dev/pre-push-tests.sh
=====================================
--- a/scripts/dev/pre-push-tests.sh
+++ b/scripts/dev/pre-push-tests.sh
@@ -1,2 +1,2 @@
mypy -p gajim.common.modules --follow-imports=skip
-pylint --jobs=2 --additional-builtins=_ --disable=all --enable=C0121,C0201,C0303,C0321,C0325,C0326,C1801,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0106,E0107,E0108,E0202,E0221,E0222,E0235,E0501,E0502,E0503,E0602,E0603,E0604,E0701,E0702,E1001,E1002,E1003,E1004,E1111,E1120,E1121,E1122,E1123,E1124,E1125,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701,R0123,R0205,R1703,R1704,R1705,R1707,R1714,W0102,W0107,W0235,W0611,W0612,W0621,W0622,W0702,W1201,W1202 gajim
+pylint --jobs=2 --disable=C0103,C0113,C0123,C0200,C0203,C0302,C0305,C0330,C0411,C0412,C0413,E0203,E0213,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
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/251dbae5d631414120915d59c1dc02f87b…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/251dbae5d631414120915d59c1dc02f87b…
You're receiving this email because of your account on dev.gajim.org.