Merge from an old remote branch.

This commit is contained in:
Raoul Snyman 2009-09-06 20:59:21 +02:00
commit 94cd34d333
13 changed files with 92 additions and 20 deletions

View File

@ -8,3 +8,4 @@
lib
theme

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
This program is free software; you can redistribute it and/or modify it under
@ -21,17 +23,51 @@ import types
from PyQt4 import QtCore, QtGui
def translate(context, text):
"""
A special shortcut method to wrap around the Qt4 translation functions.
This abstracts the translation procedure so that we can change it if at a
later date if necessary, without having to redo the whole of OpenLP.
``context``
The translation context, used to give each string a context or a
namespace.
``text``
The text to put into the translation tables for translation.
"""
return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8)
def file_to_xml(xmlfile):
"""
Open a file and return the contents of the file.
``xmlfile``
The name of the file.
"""
return open(xmlfile).read()
def str_to_bool(stringvalue):
"""
Convert a string version of a boolean into a real boolean.
``stringvalue``
The string value to examine and convert to a boolean type.
"""
if stringvalue is True or stringvalue is False:
return stringvalue
return stringvalue.strip().lower() in (u'true', u'yes', u'y')
def buildIcon(icon):
"""
Build a QIcon instance from an existing QIcon, a resource location, or a
physical file location. If the icon is a QIcon instance, that icon is
simply returned. If not, it builds a QIcon instance from the resource or
file name.
``icon``
The icon to build. This can be a QIcon, a resource string in the form
``:/resource/file.png``, or a file location like ``/path/to/file.png``.
"""
ButtonIcon = None
if type(icon) is QtGui.QIcon:
ButtonIcon = icon
@ -71,8 +107,7 @@ from serviceitem import ServiceItem
from serviceitem import ServiceType
from serviceitem import ServiceItem
from toolbar import OpenLPToolbar
from songxmlhandler import SongXMLBuilder
from songxmlhandler import SongXMLParser
from songxmlhandler import SongXMLBuilder, SongXMLParser
from themexmlhandler import ThemeXML
from renderer import Renderer
from rendermanager import RenderManager

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 -2009 Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under
@ -19,6 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
"""
import os
from openlp.core.utils import ConfigHelper
class PluginConfig(object):

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley,
This program is free software; you can redistribute it and/or modify it under

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 - 2009Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under
@ -42,7 +44,7 @@ class RenderManager(object):
Defaults to *0*. The index of the output/display screen.
"""
global log
log=logging.getLogger(u'RenderManager')
log = logging.getLogger(u'RenderManager')
log.info(u'RenderManager Loaded')
def __init__(self, theme_manager, screen_list, screen_number=0):

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under
@ -37,7 +39,7 @@ class ServiceItem(object):
compositor.
"""
global log
log=logging.getLogger(u'ServiceItem')
log = logging.getLogger(u'ServiceItem')
log.info(u'Service Item created')
def __init__(self, hostplugin=None):

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under
@ -20,8 +22,9 @@ Place, Suite 330, Boston, MA 02111-1307 USA
class SettingsManager(object):
"""
Class to control the size of the UI components so they size correctly
This class is created by the main window and then calculates the size of individual components
Class to control the size of the UI components so they size correctly.
This class is created by the main window and then calculates the size of
individual components.
"""
def __init__(self, screen):
self.screen = screen[0]

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under
@ -19,6 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
"""
from PyQt4 import QtCore, QtGui
from openlp.core.lib import PluginConfig
class SettingsTab(QtGui.QWidget):

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard
This program is free software; you can redistribute it and/or modify it under
@ -16,26 +18,25 @@ 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
from xml.dom.minidom import Document
from xml.etree.ElementTree import ElementTree, XML, dump
<?xml version="1.0" encoding="UTF-8"?>
<song version="1.0">
<lyrics language="en">
<verse type="chorus" label="1">
<![CDATA[ ... ]]>
</verse>
</lyrics>
</song>
"""
import logging
from xml.dom.minidom import Document
from xml.etree.ElementTree import ElementTree, XML, dump
class SongXMLBuilder():
class SongXMLBuilder(object):
"""
This class builds the XML used to describe songs.
The basic XML looks like this::
<?xml version="1.0" encoding="UTF-8"?>
<song version="1.0">
<lyrics language="en">
<verse type="chorus" label="1">
<![CDATA[ ... ]]>
</verse>
</lyrics>
</song>
"""
def __init__(self):
"""
@ -97,9 +98,21 @@ class SongXMLBuilder():
"""
return self.song_xml.toxml(u'utf-8')
class SongXMLParser():
class SongXMLParser(object):
"""
A class to read in and parse a song's XML.
The basic XML looks like this::
<?xml version="1.0" encoding="UTF-8"?>
<song version="1.0">
<lyrics language="en">
<verse type="chorus" label="1">
<![CDATA[ ... ]]>
</verse>
</lyrics>
</song>
"""
global log
log = logging.getLogger(u'SongXMLParser')

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard
This program is free software; you can redistribute it and/or modify it under

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2009 Raoul Snyman
Portions copyright (c) 2009 Martin Thompson, Tim Bentley
This program is free software; you can redistribute it and/or modify it under

View File

@ -2,7 +2,9 @@
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Carsten Tinggaard
This program is free software; you can redistribute it and/or modify it under