openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #01653
[Merge] lp:~meths/openlp/testing into lp:openlp
Jon Tibble has proposed merging lp:~meths/openlp/testing into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Refactor BaseModel
--
https://code.launchpad.net/~meths/openlp/testing/+merge/26372
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/testing into lp:openlp.
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py 2010-05-27 08:42:56 +0000
+++ openlp/core/lib/__init__.py 2010-05-29 21:38:26 +0000
@@ -184,4 +184,5 @@
from themexmlhandler import ThemeXML
from renderer import Renderer
from rendermanager import RenderManager
+from basemodel import BaseModel
from baselistwithdnd import BaseListWithDnD
=== added file 'openlp/core/lib/basemodel.py'
--- openlp/core/lib/basemodel.py 1970-01-01 00:00:00 +0000
+++ openlp/core/lib/basemodel.py 2010-05-29 21:38:26 +0000
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+
+###############################################################################
+# OpenLP - Open Source Lyrics Projection #
+# --------------------------------------------------------------------------- #
+# Copyright (c) 2008-2010 Raoul Snyman #
+# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
+# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin #
+# Thompson, Jon Tibble, Carsten Tinggaard #
+# --------------------------------------------------------------------------- #
+# This program is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU General Public License as published by the Free #
+# Software Foundation; version 2 of the License. #
+# #
+# This program is distributed in the hope that it will be useful, but WITHOUT #
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
+# more details. #
+# #
+# You should have received a copy of the GNU General Public License along #
+# with this program; if not, write to the Free Software Foundation, Inc., 59 #
+# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
+###############################################################################
+
+class BaseModel(object):
+ """
+ BaseModel provides a base object with a set of generic functions
+ """
+
+ @classmethod
+ def populate(cls, **kwargs):
+ """
+ Creates an instance of a class and populates it, returning the instance
+ """
+ me = cls()
+ for key in kwargs:
+ me.__setattr__(key, kwargs[key])
+ return me
+
=== modified file 'openlp/migration/migratebibles.py'
--- openlp/migration/migratebibles.py 2010-05-25 14:30:34 +0000
+++ openlp/migration/migratebibles.py 2010-05-29 21:38:26 +0000
@@ -30,7 +30,7 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker, mapper
-from openlp.core.lib import SettingsManager
+from openlp.core.lib import BaseModel, SettingsManager
from openlp.core.utils import AppLocation
from openlp.plugins.bibles.lib.models import *
=== modified file 'openlp/migration/migratesongs.py'
--- openlp/migration/migratesongs.py 2010-05-25 14:30:34 +0000
+++ openlp/migration/migratesongs.py 2010-05-29 21:38:26 +0000
@@ -31,7 +31,7 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker, mapper, relation
-from openlp.core.lib import SettingsManager
+from openlp.core.lib import BaseModel, SettingsManager
from openlp.core.utils import AppLocation
from openlp.plugins.songs.lib.models import metadata, songs_table, Song, \
Author, Topic, Book
=== modified file 'openlp/plugins/alerts/lib/classes.py'
--- openlp/plugins/alerts/lib/classes.py 2010-03-21 23:58:01 +0000
+++ openlp/plugins/alerts/lib/classes.py 2010-05-29 21:38:26 +0000
@@ -23,21 +23,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-class BaseModel(object):
- """
- BaseModel provides a base object with a set of generic functions
- """
-
- @classmethod
- def populate(cls, **kwargs):
- """
- Creates an instance of a class and populates it, returning the instance
- """
- me = cls()
- keys = kwargs.keys()
- for key in keys:
- me.__setattr__(key, kwargs[key])
- return me
+from openlp.core.lib import BaseModel
class AlertItem(BaseModel):
"""
=== modified file 'openlp/plugins/bibles/lib/models.py'
--- openlp/plugins/bibles/lib/models.py 2010-03-21 23:58:01 +0000
+++ openlp/plugins/bibles/lib/models.py 2010-05-29 21:38:26 +0000
@@ -27,20 +27,7 @@
create_engine
from sqlalchemy.orm import mapper, relation, sessionmaker, scoped_session
-class BaseModel(object):
- """
- BaseModel provides a base object with a set of generic functions
- """
- @classmethod
- def populate(cls, **kwargs):
- """
- Creates an instance of a class and populates it, returning the instance
- """
- me = cls()
- keys = kwargs.keys()
- for key in keys:
- me.__setattr__(key, kwargs[key])
- return me
+from openlp.core.lib import BaseModel
class BibleMeta(BaseModel):
=== modified file 'openlp/plugins/custom/lib/classes.py'
--- openlp/plugins/custom/lib/classes.py 2010-03-21 23:58:01 +0000
+++ openlp/plugins/custom/lib/classes.py 2010-05-29 21:38:26 +0000
@@ -23,21 +23,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-class BaseModel(object):
- """
- BaseModel provides a base object with a set of generic functions
- """
-
- @classmethod
- def populate(cls, **kwargs):
- """
- Creates an instance of a class and populates it, returning the instance
- """
- me = cls()
- keys = kwargs.keys()
- for key in keys:
- me.__setattr__(key, kwargs[key])
- return me
+from openlp.core.lib import BaseModel
class CustomSlide(BaseModel):
"""
=== modified file 'openlp/plugins/songs/lib/classes.py'
--- openlp/plugins/songs/lib/classes.py 2010-05-25 23:07:50 +0000
+++ openlp/plugins/songs/lib/classes.py 2010-05-29 21:38:26 +0000
@@ -23,21 +23,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-class BaseModel(object):
- """
- BaseModel provides a base object with a set of generic functions
- """
-
- @classmethod
- def populate(cls, **kwargs):
- """
- Creates an instance of a class and populates it, returning the instance
- """
- me = cls()
- keys = kwargs.keys()
- for key in keys:
- me.__setattr__(key, kwargs[key])
- return me
+from openlp.core.lib import BaseModel
class Author(BaseModel):
"""
=== modified file 'openlp/plugins/songusage/lib/classes.py'
--- openlp/plugins/songusage/lib/classes.py 2010-03-21 23:58:01 +0000
+++ openlp/plugins/songusage/lib/classes.py 2010-05-29 21:38:26 +0000
@@ -23,21 +23,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-class BaseModel(object):
- """
- BaseModel provides a base object with a set of generic functions
- """
-
- @classmethod
- def populate(cls, **kwargs):
- """
- Creates an instance of a class and populates it, returning the instance
- """
- me = cls()
- keys = kwargs.keys()
- for key in keys:
- me.__setattr__(key, kwargs[key])
- return me
+from openlp.core.lib import BaseModel
class SongUsageItem(BaseModel):
"""
Follow ups