forked from openlp/openlp
Stop Presentation Tab failing
CSV Bibles get Unicode
This commit is contained in:
parent
36113b0d90
commit
93655bc92e
@ -16,6 +16,7 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
import logging
|
||||
import chardet
|
||||
|
||||
from openlp.plugins.bibles.lib.bibleDBimpl import BibleDBImpl
|
||||
from openlp.plugins.bibles.lib.common import BibleCommon
|
||||
@ -46,16 +47,19 @@ class BibleCSVImpl(BibleCommon):
|
||||
|
||||
count = 0
|
||||
for line in fbooks:
|
||||
#log.debug( line)
|
||||
if self.loadbible == False: # cancel pressed
|
||||
# cancel pressed
|
||||
if self.loadbible == False:
|
||||
break
|
||||
details = chardet.detect(line)
|
||||
line = unicode(line, details['encoding'])
|
||||
p = line.split(u',')
|
||||
p1 = p[1].replace(u'"', u'')
|
||||
p2 = p[2].replace(u'"', u'')
|
||||
p3 = p[3].replace(u'"', u'')
|
||||
self.bibledb.create_book(p2, p3, int(p1))
|
||||
count += 1
|
||||
if count % 3 == 0: #Every x verses repaint the screen
|
||||
#Flush the screen events
|
||||
if count % 3 == 0:
|
||||
Receiver().send_message(u'openlpprocessevents')
|
||||
count = 0
|
||||
|
||||
@ -64,16 +68,20 @@ class BibleCSVImpl(BibleCommon):
|
||||
for line in fverse:
|
||||
if self.loadbible == False: # cancel pressed
|
||||
break
|
||||
#log.debug( line)
|
||||
p = line.split(u',', 3) # split into 3 units and leave the rest as a single field
|
||||
details = chardet.detect(line)
|
||||
line = unicode(line, details['encoding'])
|
||||
# split into 3 units and leave the rest as a single field
|
||||
p = line.split(u',', 3)
|
||||
p0 = p[0].replace(u'"', u'')
|
||||
p3 = p[3].replace(u'"',u'')
|
||||
if book_ptr is not p0:
|
||||
book = self.bibledb.get_bible_book(p0)
|
||||
book_ptr = book.name
|
||||
dialogobject.incrementProgressBar(book.name) # increament the progress bar
|
||||
# increament the progress bar
|
||||
dialogobject.incrementProgressBar(book.name)
|
||||
self.bibledb.add_verse(book.id, p[1], p[2], p3)
|
||||
count += 1
|
||||
if count % 3 == 0: #Every x verses repaint the screen
|
||||
#Every x verses repaint the screen
|
||||
if count % 3 == 0:
|
||||
Receiver().send_message(u'openlpprocessevents')
|
||||
count = 0
|
@ -70,9 +70,7 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget)
|
||||
self.DisplayTypeLabel.setObjectName(u'SearchTypeLabel')
|
||||
self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1)
|
||||
|
||||
self.DisplayTypeLabel.setText(translate(u'PresentationMediaItem', u'Present using:'))
|
||||
|
||||
# Add the Presentation widget to the page layout
|
||||
self.PageLayout.addWidget(self.PresentationWidget)
|
||||
|
||||
|
@ -52,6 +52,7 @@ class PresentationPlugin(Plugin):
|
||||
|
||||
def check_pre_conditions(self):
|
||||
log.debug('check_pre_conditions')
|
||||
self.openoffice = Openoffice()
|
||||
return self.openoffice.checkOoPid()
|
||||
return True
|
||||
# self.openoffice = Openoffice()
|
||||
# return self.openoffice.checkOoPid()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user