Whitespace & unused imports

This commit is contained in:
Jon Tibble 2010-11-24 01:51:08 +00:00
parent 3ae6d7db97
commit 1c11cab27b
8 changed files with 27 additions and 22 deletions

View File

@ -303,8 +303,8 @@ def expand_tags(text):
text = text.replace(tag[u'end tag'], tag[u'end html'])
return text
from theme import ThemeLevel, ThemeXML, BackgroundGradientType, BackgroundType, \
HorizontalType, VerticalType
from theme import ThemeLevel, ThemeXML, BackgroundGradientType, \
BackgroundType, HorizontalType, VerticalType
from spelltextedit import SpellTextEdit
from eventreceiver import Receiver
from imagemanager import ImageManager

View File

@ -371,7 +371,8 @@ def build_background_css(item, width, height):
theme = item.themedata
background = u'background-color: black'
if theme:
if theme.background_type == BackgroundType.to_string(BackgroundType.Solid):
if theme.background_type == BackgroundType.to_string(
BackgroundType.Solid):
background = u'background-color: %s' % theme.background_color
else:
if theme.background_direction == BackgroundGradientType.to_string \
@ -381,22 +382,22 @@ def build_background_css(item, width, height):
u'-webkit-gradient(linear, left top, left bottom, ' \
'from(%s), to(%s))' % (theme.background_start_color,
theme.background_end_color)
elif theme.background_direction == BackgroundGradientType.to_string \
(BackgroundGradientType.LeftTop):
elif theme.background_direction == BackgroundGradientType.to_string(
BackgroundGradientType.LeftTop):
background = \
u'background: ' \
u'-webkit-gradient(linear, left top, right bottom, ' \
'from(%s), to(%s))' % (theme.background_start_color,
theme.background_end_color)
elif theme.background_direction == BackgroundGradientType.to_string \
(BackgroundGradientType.LeftBottom):
elif theme.background_direction == BackgroundGradientType.to_string(
BackgroundGradientType.LeftBottom):
background = \
u'background: ' \
u'-webkit-gradient(linear, left bottom, right top, ' \
'from(%s), to(%s))' % (theme.background_start_color,
theme.background_end_color)
elif theme.background_direction == BackgroundGradientType.to_string \
(BackgroundGradientType.Vertical):
elif theme.background_direction == BackgroundGradientType.to_string(
BackgroundGradientType.Vertical):
background = \
u'background: -webkit-gradient(linear, left top, ' \
u'right top, from(%s), to(%s))' % \

View File

@ -474,8 +474,8 @@ class MediaManagerItem(QtGui.QWidget):
translate('OpenLP.MediaManagerItem',
'You must select one or more items.'))
else:
# Is it posssible to process multiple list items to generate multiple
# service items?
# Is it posssible to process multiple list items to generate
# multiple service items?
if self.singleServiceItem or self.remoteTriggered:
log.debug(self.plugin.name + u' Add requested')
service_item = self.buildServiceItem()
@ -504,7 +504,7 @@ class MediaManagerItem(QtGui.QWidget):
log.debug(self.plugin.name + u' Add requested')
service_item = self.parent.serviceManager.getServiceItem()
if not service_item:
QtGui.QMessageBox.information(self,
QtGui.QMessageBox.information(self,
translate('OpenLP.MediaManagerItem',
'No Service Item Selected'),
translate('OpenLP.MediaManagerItem',

View File

@ -33,7 +33,7 @@ except ImportError:
enchant_available = False
# based on code from
# http://john.nachtimwald.com/2009/08/22/qplaintextedit-with-in-line-spell-check/
#http://john.nachtimwald.com/2009/08/22/qplaintextedit-with-in-line-spell-check/
from PyQt4 import QtCore, QtGui
from openlp.core.lib import html_expands, translate

View File

@ -31,7 +31,6 @@ import re
import logging
from xml.dom.minidom import Document
from xml.etree.ElementTree import ElementTree, XML
from lxml import etree, objectify
from openlp.core.lib import str_to_bool
@ -261,8 +260,9 @@ class ThemeXML(object):
def add_font(self, name, color, size, override, fonttype=u'main',
bold=u'False', italics=u'False', line_adjustment=0,
xpos=0, ypos=0, width=0, height=0 , outline=u'False', outline_color=u'#ffffff',
outline_pixel=2, shadow=u'False', shadow_color=u'#ffffff', shadow_pixel=5):
xpos=0, ypos=0, width=0, height=0 , outline=u'False',
outline_color=u'#ffffff', outline_pixel=2, shadow=u'False',
shadow_color=u'#ffffff', shadow_pixel=5):
"""
Add a Font.
@ -441,7 +441,7 @@ class ThemeXML(object):
if line:
xml = xml[line + 2:]
try:
theme_xml = objectify.fromstring(xml)
theme_xml = objectify.fromstring(xml)
except etree.XMLSyntaxError:
log.exception(u'Invalid xml %s', xml)
return
@ -457,7 +457,8 @@ class ThemeXML(object):
if element.getparent().tag == u'display':
if element.tag.startswith(u'shadow') or \
element.tag.startswith(u'outline'):
self._create_attr(u'font_main', element.tag, element.text)
self._create_attr(u'font_main', element.tag,
element.text)
master = element.getparent().tag
if element.getparent().tag == u'background':
master = element.getparent().tag
@ -471,7 +472,8 @@ class ThemeXML(object):
for attr in element.attrib:
base_element = attr
# correction for the shadow and outline tags
if element.tag == u'shadow' or element.tag == u'outline':
if element.tag == u'shadow' or \
element.tag == u'outline':
if not attr.startswith(element.tag):
base_element = element.tag + u'_' + attr
self._create_attr(master, base_element,

View File

@ -82,7 +82,8 @@ class AdvancedTab(SettingsTab):
self.doubleClickLiveCheckBox.setObjectName(u'doubleClickLiveCheckBox')
self.uiLayout.addWidget(self.doubleClickLiveCheckBox)
# self.expandServiceItemCheckBox = QtGui.QCheckBox(self.uiGroupBox)
# self.expandServiceItemCheckBox.setObjectName(u'expandServiceItemCheckBox')
# self.expandServiceItemCheckBox.setObjectName(
# u'expandServiceItemCheckBox')
# self.uiLayout.addWidget(self.expandServiceItemCheckBox)
self.leftLayout.addWidget(self.uiGroupBox)
self.expandServiceItemCheckBox = QtGui.QCheckBox(self.uiGroupBox)

View File

@ -596,5 +596,5 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
new_color = QtGui.QColorDialog.getColor(
QtGui.QColor(field), self)
if new_color.isValid():
field = new_color.name()
field = new_color.name()
return field

View File

@ -630,7 +630,8 @@ class ThemeManager(QtGui.QWidget):
newtheme.font_main_shadow_color = unicode(theme.ShadowColor.name())
if theme.Outline == 1:
newtheme.font_main_outline = True
newtheme.font_main_outline_color = unicode(theme.OutlineColor.name())
newtheme.font_main_outline_color = unicode(
theme.OutlineColor.name())
vAlignCorrection = 0
if theme.VerticalAlign == 2:
vAlignCorrection = 1