From a72b4283bf9d72e3e8b9d9ba262e85f6dc87e3c2 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 4 Feb 2013 22:27:50 +0100 Subject: [PATCH] removed mutable as parameters --- openlp/core/lib/ui.py | 4 +++- openlp/plugins/remotes/lib/httpserver.py | 4 +++- openlp/plugins/songs/lib/sundayplusimport.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 0d869d724..c6860d7cd 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -67,7 +67,7 @@ def add_welcome_page(parent, image): parent.addPage(parent.welcomePage) -def create_button_box(dialog, name, standard_buttons, custom_buttons=[]): +def create_button_box(dialog, name, standard_buttons, custom_buttons=None): """ Creates a QDialogButtonBox with the given buttons. The ``accepted()`` and ``rejected()`` signals of the button box are connected with the dialogs @@ -88,6 +88,8 @@ def create_button_box(dialog, name, standard_buttons, custom_buttons=[]): QtGui.QAbstractButton it is added with QDialogButtonBox.ActionRole. Otherwhise the item has to be a tuple of a button and a ButtonRole. """ + if custom_buttons is None: + custom_buttons = [] buttons = QtGui.QDialogButtonBox.NoButton if u'ok' in standard_buttons: buttons |= QtGui.QDialogButtonBox.Ok diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index af12cc9c4..d444fc1c4 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -138,7 +138,9 @@ class HttpResponse(object): 'Content-Type': 'text/html; charset="utf-8"\r\n' } - def __init__(self, content='', headers={}, code=None): + def __init__(self, content='', headers=None, code=None): + if headers is None: + headers = {} self.content = content for key, value in headers.iteritems(): self.headers[key] = value diff --git a/openlp/plugins/songs/lib/sundayplusimport.py b/openlp/plugins/songs/lib/sundayplusimport.py index 14bac8526..bfa03b24e 100644 --- a/openlp/plugins/songs/lib/sundayplusimport.py +++ b/openlp/plugins/songs/lib/sundayplusimport.py @@ -121,7 +121,7 @@ class SundayPlusImport(SongImport): end = data.find(')', i) + 1 value = data[i:end] # If we are in the main group. - if cell == False: + if not cell: if name == 'title': self.title = self.decode(self.unescape(value)) elif name == 'Author':