Fix multiple-statements pylint errors

This commit is contained in:
Philipp Hörist 2018-09-18 10:30:33 +02:00 committed by Philipp Hörist
parent 5d1de209a8
commit a65d88c1cd
4 changed files with 16 additions and 8 deletions

View File

@ -120,7 +120,8 @@ if app.is_installed('GPG'):
"""
Remove header and footer from data
"""
if not data: return ''
if not data:
return ''
lines = data.splitlines()
while lines[0] != '':
lines.remove(lines[0])
@ -129,7 +130,8 @@ if app.is_installed('GPG'):
i = 0
for line in lines:
if line:
if line[0] == '-': break
if line[0] == '-':
break
i = i+1
line = '\n'.join(lines[0:i])
return line

View File

@ -99,7 +99,8 @@ class Zeroconf:
if resolved_info[i][ConstantRI.INTERFACE] == interface and resolved_info[i][ConstantRI.PROTOCOL] == protocol:
del self.contacts[key][Constant.RESOLVED_INFO][i]
# if still something left, don't remove
if len(self.contacts[key][Constant.RESOLVED_INFO]) > 1: return
if len(self.contacts[key][Constant.RESOLVED_INFO]) > 1:
return
del self.contacts[key]
self.remove_serviceCB(key)
return

View File

@ -349,7 +349,8 @@ class SingleForm(Gtk.Table):
# for each field...
for field in self._data_form.iter_fields():
if field.type_ == 'hidden': continue
if field.type_ == 'hidden':
continue
commonlabel = True
commonlabelcenter = False

View File

@ -2034,7 +2034,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
sensitive appropriately
"""
# we have nothing to do if we don't have buttons...
if self.subscribe_button is None: return
if self.subscribe_button is None:
return
model, iter_ = self.window.services_treeview.get_selection().get_selected()
if not iter_ or self.subscriptions is None:
@ -2053,7 +2054,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
Called when 'post' button is pressed. Open window to create post
"""
model, iter_ = self.window.services_treeview.get_selection().get_selected()
if iter_ is None: return
if iter_ is None:
return
groupnode = model.get_value(iter_, 1) # 1 = groupnode
@ -2064,7 +2066,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
Called when 'subscribe' button is pressed. Send subscribtion request
"""
model, iter_ = self.window.services_treeview.get_selection().get_selected()
if iter_ is None: return
if iter_ is None:
return
node = model.get_value(iter_, 1) # 1 = groupnode
@ -2077,7 +2080,8 @@ class DiscussionGroupsBrowser(AgentBrowser):
Called when 'unsubscribe' button is pressed. Send unsubscription request
"""
model, iter_ = self.window.services_treeview.get_selection().get_selected()
if iter_ is None: return
if iter_ is None:
return
node = model.get_value(iter_, 1) # 1 = groupnode