← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/biblefixes into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/biblefixes into lp:openlp with lp:~trb143/openlp/working as a prerequisite.

    Requested reviews:
    OpenLP Core (openlp-core)


Fix up bible issues from 700 merge.
Dependent on trb143/working
-- 
https://code.launchpad.net/~trb143/openlp/biblefixes/+merge/18765
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/csvbible.py'
--- openlp/plugins/bibles/lib/csvbible.py	2010-01-31 19:51:23 +0000
+++ openlp/plugins/bibles/lib/csvbible.py	2010-02-06 16:55:21 +0000
@@ -51,15 +51,15 @@
         if u'versesfile' not in kwargs:
             raise KeyError(u'You have to supply a file to import verses from.')
         self.versesfile = kwargs[u'versesfile']
-        #QtCore.QObject.connect(Receiver.get_receiver(),
-        #    QtCore.SIGNAL(u'openlpstopimport'), self.stop_import)
+        QtCore.QObject.connect(Receiver.get_receiver(),
+            QtCore.SIGNAL(u'openlpstopimport'), self.stop_import)
 
     def stop_import(self):
         """
         Stops the import of the Bible.
         """
         log.debug('Stopping import!')
-        self.stop_import = True
+        self.stop_import_flag = True
 
     def do_import(self):
         #Populate the Tables
@@ -72,7 +72,7 @@
             books_reader = csv.reader(books_file, dialect)
             for line in books_reader:
                 # cancel pressed
-                if self.stop_import:
+                if self.stop_import_flag:
                     break
                 details = chardet.detect(line[1])
                 self.create_book(unicode(line[1], details['encoding']),
@@ -94,7 +94,7 @@
             verse_file.seek(0)
             verse_reader = csv.reader(verse_file, dialect)
             for line in verse_reader:
-                if self.stop_import:  # cancel pressed
+                if self.stop_import_flag:  # cancel pressed
                     break
                 details = chardet.detect(line[3])
                 if book_ptr != line[0]:
@@ -113,7 +113,7 @@
         finally:
             if verse_file:
                 verse_file.close()
-        if self.stop_import:
+        if self.stop_import_flag:
             self.wizard.incrementProgressBar(u'Import canceled!')
             return False
         else:

=== modified file 'openlp/plugins/bibles/lib/db.py'
--- openlp/plugins/bibles/lib/db.py	2010-02-06 10:22:20 +0000
+++ openlp/plugins/bibles/lib/db.py	2010-02-06 16:55:21 +0000
@@ -67,7 +67,7 @@
             raise KeyError(u'Missing keyword argument "name".')
         if u'config' not in kwargs:
             raise KeyError(u'Missing keyword argument "config".')
-        self.stop_import = False
+        self.stop_import_flag = False
         self.name = kwargs[u'name']
         self.config = kwargs[u'config']
         self.db_file = os.path.join(kwargs[u'path'],

=== modified file 'openlp/plugins/bibles/lib/opensong.py'
--- openlp/plugins/bibles/lib/opensong.py	2010-01-31 19:51:23 +0000
+++ openlp/plugins/bibles/lib/opensong.py	2010-02-06 16:55:21 +0000
@@ -52,15 +52,15 @@
         if 'filename' not in kwargs:
             raise KeyError(u'You have to supply a file name to import from.')
         self.filename = kwargs['filename']
-        #QtCore.QObject.connect(Receiver.get_receiver(),
-        #    QtCore.SIGNAL(u'openlpstopimport'), self.stop_import)
+        QtCore.QObject.connect(Receiver.get_receiver(),
+            QtCore.SIGNAL(u'openlpstopimport'), self.stop_import)
 
     def stop_import(self):
         """
         Stops the import of the Bible.
         """
         log.debug('Stopping import!')
-        self.stop_import = True
+        self.stop_import_flag = True
 
     def do_import(self):
         """
@@ -79,15 +79,15 @@
             opensong = objectify.parse(file)
             bible = opensong.getroot()
             for book in bible.b:
-                if self.stop_import:
+                if self.stop_import_flag:
                     break
                 db_book = self.create_book(unicode(book.attrib[u'n']),
                     unicode(book.attrib[u'n'][:4]))
                 for chapter in book.c:
-                    if self.stop_import:
+                    if self.stop_import_flag:
                         break
                     for verse in chapter.v:
-                        if self.stop_import:
+                        if self.stop_import_flag:
                             break
                         self.create_verse(
                             db_book.id,

=== modified file 'openlp/plugins/bibles/lib/osis.py'
--- openlp/plugins/bibles/lib/osis.py	2010-01-31 19:51:23 +0000
+++ openlp/plugins/bibles/lib/osis.py	2010-02-06 16:55:21 +0000
@@ -81,15 +81,15 @@
         finally:
             if fbibles:
                 fbibles.close()
-        #QtCore.QObject.connect(Receiver.get_receiver(),
-        #    QtCore.SIGNAL(u'openlpstopimport'), self.stop_import)
+        QtCore.QObject.connect(Receiver.get_receiver(),
+            QtCore.SIGNAL(u'openlpstopimport'), self.stop_import)
 
     def stop_import(self):
         """
         Stops the import of the Bible.
         """
         log.debug('Stopping import!')
-        self.stop_import = True
+        self.stop_import_flag = True
 
     def do_import(self):
         """
@@ -114,7 +114,7 @@
             testament = 1
             db_book = None
             for file_record in osis:
-                if self.stop_import:
+                if self.stop_import_flag:
                     break
                 match = self.verse_regex.search(file_record)
                 if match:
@@ -126,7 +126,7 @@
                         log.debug('New book: "%s"', self.books[book][0])
                         if book == u'Matt':
                             testament += 1
-                        db_book = self.bibledb.create_book(
+                        db_book = self.create_book(
                             unicode(self.books[book][0]),
                             unicode(self.books[book][1]),
                             testament)
@@ -137,7 +137,7 @@
                             self.wizard.ImportProgressBar.setMaximum(260)
                     if last_chapter != chapter:
                         if last_chapter != 0:
-                            self.bibledb.save_verses()
+                            self.commit()
                         self.wizard.incrementProgressBar(
                             u'Importing %s %s...' % \
                             (self.books[match.group(1)][0], chapter))
@@ -170,9 +170,8 @@
         finally:
             if osis:
                 osis.close()
-        if self.stop_import:
+        if self.stop_import_flag:
             self.wizard.incrementProgressBar(u'Import canceled!')
             return False
         else:
             return success
-


Follow ups