mirror of https://gitlab.com/openlp/openlp.git
Double space cleanup
This commit is contained in:
parent
17d6fd2ba4
commit
873e16f3a6
|
@ -192,7 +192,7 @@ class Renderer(object):
|
|||
#Find the next space to the left
|
||||
pos = line[:pos].rfind(u' ')
|
||||
#no more spaces found
|
||||
if pos == 0:
|
||||
if pos == 0:
|
||||
split_text = line
|
||||
while metrics.width(split_text, -1) > line_width:
|
||||
split_text = split_text[:-1]
|
||||
|
|
|
@ -78,7 +78,8 @@ class RenderManager(object):
|
|||
log.debug(u'Update Display')
|
||||
if self.current_display != screen_number:
|
||||
self.current_display = screen_number
|
||||
self.calculate_default(self.screen_list[self.current_display][u'size'])
|
||||
self.calculate_default(
|
||||
self.screen_list[self.current_display][u'size'])
|
||||
|
||||
def set_global_theme(self, global_theme, global_style=u'Global'):
|
||||
"""
|
||||
|
|
|
@ -101,7 +101,7 @@ class ServiceItem(object):
|
|||
for line in format:
|
||||
lines += line + u'\n'
|
||||
title = lines.split(u'\n')[0]
|
||||
self.frames.append({u'title': title ,u'text':lines,
|
||||
self.frames.append({u'title': title, u'text': lines,
|
||||
u'image': frame})
|
||||
elif self.service_item_type == ServiceType.Command:
|
||||
self.frames = self.service_frames
|
||||
|
|
|
@ -43,9 +43,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||
self.setupUi(self)
|
||||
#define signals
|
||||
#Buttons
|
||||
QtCore.QObject.connect(self.Color1PushButton ,
|
||||
QtCore.QObject.connect(self.Color1PushButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onColor1PushButtonClicked)
|
||||
QtCore.QObject.connect(self.Color2PushButton ,
|
||||
QtCore.QObject.connect(self.Color2PushButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onColor2PushButtonClicked)
|
||||
QtCore.QObject.connect(self.FontMainColorPushButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onFontMainColorPushButtonClicked)
|
||||
|
@ -250,13 +250,13 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||
self.previewTheme(self.theme)
|
||||
|
||||
def onFontMainWeightComboBoxSelected(self, value):
|
||||
if value ==0:
|
||||
if value == 0:
|
||||
self.theme.font_main_weight = u'Normal'
|
||||
self.theme.font_main_italics = False
|
||||
elif value == 1:
|
||||
elif value == 1:
|
||||
self.theme.font_main_weight = u'Bold'
|
||||
self.theme.font_main_italics = False
|
||||
elif value == 2:
|
||||
elif value == 2:
|
||||
self.theme.font_main_weight = u'Normal'
|
||||
self.theme.font_main_italics = True
|
||||
else:
|
||||
|
@ -327,13 +327,13 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||
self.previewTheme(self.theme)
|
||||
|
||||
def onFontFooterWeightComboBoxSelected(self, value):
|
||||
if value == 0:
|
||||
if value == 0:
|
||||
self.theme.font_footer_weight = u'Normal'
|
||||
self.theme.font_footer_italics = False
|
||||
elif value == 1:
|
||||
elif value == 1:
|
||||
self.theme.font_footer_weight = u'Bold'
|
||||
self.theme.font_footer_italics = False
|
||||
elif value == 2:
|
||||
elif value == 2:
|
||||
self.theme.font_footer_weight = u'Normal'
|
||||
self.theme.font_footer_italics = True
|
||||
else:
|
||||
|
|
|
@ -105,7 +105,7 @@ class ThemeManager(QtGui.QWidget):
|
|||
if oldName != newName:
|
||||
self.ThemeListWidget.item(count).setText(newName)
|
||||
#Set the new name
|
||||
if themeName == newName:
|
||||
if themeName == newName:
|
||||
name = u'%s (%s)' % (newName, translate(u'ThemeManager',
|
||||
u'default'))
|
||||
self.ThemeListWidget.item(count).setText(name)
|
||||
|
@ -120,7 +120,7 @@ class ThemeManager(QtGui.QWidget):
|
|||
self.ThemeListWidget.item(count).setText(
|
||||
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
||||
#Set the new name
|
||||
if count == index.row():
|
||||
if count == index.row():
|
||||
self.global_theme = unicode(
|
||||
self.ThemeListWidget.item(count).text())
|
||||
name = u'%s (%s)' % (self.global_theme,
|
||||
|
@ -158,7 +158,7 @@ class ThemeManager(QtGui.QWidget):
|
|||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||
else:
|
||||
self.themelist.remove(theme)
|
||||
th = theme + u'.png'
|
||||
th = theme + u'.png'
|
||||
row = self.ThemeListWidget.row(item)
|
||||
self.ThemeListWidget.takeItem(row)
|
||||
try:
|
||||
|
|
|
@ -155,13 +155,13 @@ class MigrateSongs():
|
|||
song.search_title = u''
|
||||
song.search_lyrics = u''
|
||||
print songs_temp.songtitle
|
||||
aa = self.session.execute(
|
||||
aa = self.session.execute(
|
||||
u'select * from songauthors_temp where songid =' + \
|
||||
unicode(songs_temp.songid) )
|
||||
for row in aa:
|
||||
a = row['authorid']
|
||||
authors_temp = self.session.query(TAuthor).get(a)
|
||||
bb = self.session.execute(
|
||||
bb = self.session.execute(
|
||||
u'select * from authors where display_name = \"%s\"' % \
|
||||
unicode(authors_temp.authorname) ).fetchone()
|
||||
if bb is None:
|
||||
|
|
|
@ -41,7 +41,7 @@ class BibleDBImpl(BibleCommon):
|
|||
log.debug(u'Load bible %s on path %s', biblename, self.biblefile)
|
||||
db_type = self.config.get_config(u'db type', u'sqlite')
|
||||
db_url = u''
|
||||
if db_type == u'sqlite':
|
||||
if db_type == u'sqlite':
|
||||
db_url = u'sqlite:///' + self.biblefile
|
||||
else:
|
||||
db_url = u'%s://%s:%s@%s/%s' % \
|
||||
|
|
|
@ -73,11 +73,11 @@ class BGExtract(BibleCommon):
|
|||
verseText = '' # clear out string
|
||||
versePos = xml_string.find(u'</span', versePos)
|
||||
i = xml_string.find(VerseSearch, versePos+1)
|
||||
#print i , versePos
|
||||
#print i, versePos
|
||||
if i == -1:
|
||||
i = xml_string.find(u'</div', versePos+1)
|
||||
j = xml_string.find(u'<strong', versePos+1)
|
||||
#print i , j
|
||||
#print i, j
|
||||
if j > 0 and j < i:
|
||||
i = j
|
||||
verseText = xml_string[versePos + 7 : i ]
|
||||
|
|
|
@ -141,7 +141,7 @@ class BibleOSISImpl():
|
|||
# first time through
|
||||
if book_ptr == None:
|
||||
# set the max book size depending on the first book read
|
||||
if p[0] == u'Gen':
|
||||
if p[0] == u'Gen':
|
||||
dialogobject.setMax(65)
|
||||
else:
|
||||
dialogobject.setMax(27)
|
||||
|
|
|
@ -61,7 +61,7 @@ class BibleManager(object):
|
|||
# dict of bible database objects
|
||||
self.bible_db_cache = None
|
||||
# dict of bible http readers
|
||||
self.bible_http_cache = None
|
||||
self.bible_http_cache = None
|
||||
self.biblePath = self.config.get_data_path()
|
||||
#get proxy name for screen
|
||||
self.proxyname = self.config.get_config(u'proxy name')
|
||||
|
@ -83,12 +83,12 @@ class BibleManager(object):
|
|||
files = self.config.get_files(self.bibleSuffix)
|
||||
log.debug(u'Bible Files %s', files )
|
||||
self.bible_db_cache = {}
|
||||
self.bible_http_cache = {}
|
||||
self.bible_http_cache = {}
|
||||
# books of the bible with testaments
|
||||
self.book_testaments = {}
|
||||
# books of the bible with abbreviation
|
||||
self.book_abbreviations = {}
|
||||
self.web_bibles_present = False
|
||||
self.web_bibles_present = False
|
||||
for f in files:
|
||||
nme = f.split(u'.')
|
||||
bname = nme[0]
|
||||
|
@ -97,7 +97,7 @@ class BibleManager(object):
|
|||
# look to see if lazy load bible exists and get create getter.
|
||||
biblesource = self.bible_db_cache[bname].get_meta(u'WEB')
|
||||
if biblesource:
|
||||
self.web_bibles_present = True
|
||||
self.web_bibles_present = True
|
||||
nhttp = BibleHTTPImpl()
|
||||
# tell The Server where to get the verses from.
|
||||
nhttp.set_bible_source(biblesource.value)
|
||||
|
@ -226,7 +226,7 @@ class BibleManager(object):
|
|||
viewer. If the database exists it is deleted and the database is
|
||||
reloaded from scratch.
|
||||
"""
|
||||
log.debug(u'register_OSIS_file_bible %s , %s', biblename, osisfile)
|
||||
log.debug(u'register_OSIS_file_bible %s, %s', biblename, osisfile)
|
||||
if self._is_new_bible(biblename):
|
||||
# Create new Bible
|
||||
nbible = BibleDBImpl(self.biblePath, biblename, self.config)
|
||||
|
@ -240,7 +240,7 @@ class BibleManager(object):
|
|||
return True
|
||||
else:
|
||||
log.debug(
|
||||
u'register_OSIS_file_bible %s , %s not created already exists',
|
||||
u'register_OSIS_file_bible %s, %s not created already exists',
|
||||
biblename, osisfile)
|
||||
return False
|
||||
|
||||
|
@ -324,7 +324,7 @@ c
|
|||
|
||||
Rest can be guessed at !
|
||||
"""
|
||||
text = []
|
||||
text = []
|
||||
self.media.setQuickMsg1(u'')
|
||||
self.media.setQuickMsg2(u'')
|
||||
log.debug(u'get_verse_text %s,%s,%s,%s,%s,%s',
|
||||
|
@ -355,7 +355,7 @@ c
|
|||
book = self.bible_db_cache[bible].create_book(
|
||||
bookname, self.book_abbreviations[bookname],
|
||||
self.book_testaments[bookname])
|
||||
log.debug(u'New http book %s , %s, %s',
|
||||
log.debug(u'New http book %s, %s, %s',
|
||||
book, book.id, book.name)
|
||||
self.bible_db_cache[bible].create_chapter(
|
||||
book.id, search_results.get_chapter(),
|
||||
|
@ -414,7 +414,7 @@ c
|
|||
"""
|
||||
Check cache to see if new bible
|
||||
"""
|
||||
for b , o in self.bible_db_cache.iteritems():
|
||||
for b, o in self.bible_db_cache.iteritems():
|
||||
log.debug(u'Bible from cache in is_new_bible %s', b )
|
||||
if b == name :
|
||||
return False
|
||||
|
|
|
@ -407,7 +407,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||
raw_footer.index(footer)
|
||||
except:
|
||||
raw_footer.append(footer)
|
||||
if len(self.parent.bibles_tab.bible_theme) == 0:
|
||||
if len(self.parent.bibles_tab.bible_theme) == 0:
|
||||
service_item.theme = None
|
||||
else:
|
||||
service_item.theme = self.parent.bibles_tab.bible_theme
|
||||
|
@ -446,7 +446,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||
self.initialiseChapterVerse(bible, book.name)
|
||||
|
||||
def initialiseChapterVerse(self, bible, book):
|
||||
log.debug(u'initialiseChapterVerse %s , %s', bible, book)
|
||||
log.debug(u'initialiseChapterVerse %s, %s', bible, book)
|
||||
self.chapters_from = self.parent.biblemanager.get_book_chapter_count(
|
||||
bible, book)
|
||||
self.verses = self.parent.biblemanager.get_book_verse_count(bible,
|
||||
|
@ -456,8 +456,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||
self.adjustComboBox(1, self.verses, self.AdvancedFromVerse)
|
||||
self.adjustComboBox(1, self.verses, self.AdvancedToVerse)
|
||||
|
||||
def adjustComboBox(self, frm, to , combo):
|
||||
log.debug(u'adjustComboBox %s , %s , %s', combo, frm, to)
|
||||
def adjustComboBox(self, frm, to, combo):
|
||||
log.debug(u'adjustComboBox %s, %s, %s', combo, frm, to)
|
||||
combo.clear()
|
||||
for i in range(int(frm), int(to) + 1):
|
||||
combo.addItem(unicode(i))
|
||||
|
@ -475,7 +475,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||
cr.setSelected(True)
|
||||
|
||||
def searchByReference(self, bible, search):
|
||||
log.debug(u'searchByReference %s ,%s', bible, search)
|
||||
log.debug(u'searchByReference %s, %s', bible, search)
|
||||
book = u''
|
||||
start_chapter = u''
|
||||
end_chapter = u''
|
||||
|
|
|
@ -115,7 +115,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
|||
self.ThemeComboBox.setCurrentIndex(0)
|
||||
|
||||
def accept(self):
|
||||
valid , message = self._validate()
|
||||
valid, message = self._validate()
|
||||
if not valid:
|
||||
QtGui.QMessageBox.critical(self,
|
||||
translate(u'customEditDialog', u'Error'), message,
|
||||
|
|
|
@ -27,7 +27,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
# http://nxsy.org/comparing-documents-with-openoffice-and-python
|
||||
|
||||
import logging
|
||||
import os , subprocess
|
||||
import os, subprocess
|
||||
import time
|
||||
import sys
|
||||
|
||||
|
@ -41,9 +41,9 @@ from PyQt4 import QtCore
|
|||
|
||||
class ImpressController(object):
|
||||
"""
|
||||
Class to control interactions with Impress Presentations
|
||||
It creates the runtime Environment , Loads the and Closes the Presentation
|
||||
As well as trigggering the correct activities based on the users input
|
||||
Class to control interactions with Impress presentations.
|
||||
It creates the runtime environment, loads and closes the presentation as
|
||||
well as triggering the correct activities based on the users input
|
||||
"""
|
||||
global log
|
||||
log = logging.getLogger(u'ImpressController')
|
||||
|
@ -57,8 +57,8 @@ class ImpressController(object):
|
|||
|
||||
def startOpenoffice(self):
|
||||
"""
|
||||
Loads a running version of OpenOffice inthe background.
|
||||
It is not displayed to the user but is available to the Uno interface
|
||||
Loads a running version of OpenOffice in the background.
|
||||
It is not displayed to the user but is available to the UNO interface
|
||||
when required.
|
||||
"""
|
||||
log.debug(u'start Openoffice')
|
||||
|
|
|
@ -459,7 +459,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||
text = text.replace(u'{', u'')
|
||||
text = text.replace(u'}', u'')
|
||||
text = text.replace(u'?', u'')
|
||||
self.song.search_lyrics = unicode(text)
|
||||
self.song.search_lyrics = unicode(text)
|
||||
self.song.lyrics = unicode(sxml.extract_xml())
|
||||
|
||||
def processTitle(self):
|
||||
|
|
|
@ -178,7 +178,7 @@ class SongMediaItem(MediaManagerItem):
|
|||
|
||||
def onSearchTextButtonClick(self):
|
||||
search_keywords = unicode(self.SearchTextEdit.displayText())
|
||||
search_results = []
|
||||
search_results = []
|
||||
search_type = self.SearchTypeComboBox.currentIndex()
|
||||
if search_type == 0:
|
||||
log.debug(u'Titles Search')
|
||||
|
|
Loading…
Reference in New Issue