[Python-modules-commits] [pysword] 01/04: Imported Upstream version 0.2.3

Raoul Snyman superfly-guest at moszumanska.debian.org
Mon Mar 6 18:51:05 UTC 2017


This is an automated email from the git hooks/post-receive script.

superfly-guest pushed a commit to branch master
in repository pysword.

commit f7ab71902de0174f62417b9ee39729b4b53957ee
Author: Unit 193 <unit193 at ubuntu.com>
Date:   Sun Nov 13 15:43:10 2016 -0500

    Imported Upstream version 0.2.3
---
 PKG-INFO                  | 11 +++++++++--
 README.rst                |  7 +++++++
 pysword.egg-info/PKG-INFO | 11 +++++++++--
 pysword/bible.py          |  4 ++--
 pysword/books.py          |  7 ++++++-
 pysword/cleaner.py        |  1 +
 setup.py                  |  4 ++--
 7 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/PKG-INFO b/PKG-INFO
index c076dee..cb3ff78 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,10 +1,10 @@
 Metadata-Version: 1.1
 Name: pysword
-Version: 0.2.1
+Version: 0.2.3
 Summary: A native Python2/3 reader module for the SWORD Project Bible Modules
 Home-page: https://gitlab.com/tgc-dk/pysword
 Author: Tomas Groth
-Author-email: tomasgroth at yahoo.dk
+Author-email: second at tgc.dk
 License: GPL2
 Description: A native Python reader of the SWORD Project Bible Modules
         
@@ -100,6 +100,13 @@ Description: A native Python reader of the SWORD Project Bible Modules
         
         The tests should run and pass using both python 2 and 3.
         
+        Contributing
+        ------------
+        
+        If you want to contribute, you are most welcome to do so!
+        Feel free to report issues and create merge request at https://gitlab.com/tgc-dk/pysword
+        If you create a merge request please include a test the proves that your code actually works.
+        
         Module formats
         --------------
         
diff --git a/README.rst b/README.rst
index babeade..70d0e1e 100644
--- a/README.rst
+++ b/README.rst
@@ -92,6 +92,13 @@ for testing, and then use nosetests to run the testsuite:
 
 The tests should run and pass using both python 2 and 3.
 
+Contributing
+------------
+
+If you want to contribute, you are most welcome to do so!
+Feel free to report issues and create merge request at https://gitlab.com/tgc-dk/pysword
+If you create a merge request please include a test the proves that your code actually works.
+
 Module formats
 --------------
 
diff --git a/pysword.egg-info/PKG-INFO b/pysword.egg-info/PKG-INFO
index c076dee..cb3ff78 100644
--- a/pysword.egg-info/PKG-INFO
+++ b/pysword.egg-info/PKG-INFO
@@ -1,10 +1,10 @@
 Metadata-Version: 1.1
 Name: pysword
-Version: 0.2.1
+Version: 0.2.3
 Summary: A native Python2/3 reader module for the SWORD Project Bible Modules
 Home-page: https://gitlab.com/tgc-dk/pysword
 Author: Tomas Groth
-Author-email: tomasgroth at yahoo.dk
+Author-email: second at tgc.dk
 License: GPL2
 Description: A native Python reader of the SWORD Project Bible Modules
         
@@ -100,6 +100,13 @@ Description: A native Python reader of the SWORD Project Bible Modules
         
         The tests should run and pass using both python 2 and 3.
         
+        Contributing
+        ------------
+        
+        If you want to contribute, you are most welcome to do so!
+        Feel free to report issues and create merge request at https://gitlab.com/tgc-dk/pysword
+        If you create a merge request please include a test the proves that your code actually works.
+        
         Module formats
         --------------
         
diff --git a/pysword/bible.py b/pysword/bible.py
index 1c7ac6b..35ec643 100644
--- a/pysword/bible.py
+++ b/pysword/bible.py
@@ -76,7 +76,7 @@ class SwordBible(object):
             raise IOError(u'Could not open OT or NT for module')
 
         # Load the bible structure
-        testaments = self._files.keys()
+        testaments = list(self._files)
         self._structure = BibleStructure(versification, testaments)
 
         # Set verse record format and size
@@ -96,7 +96,7 @@ class SwordBible(object):
         # Detect text-encoding if none given
         if encoding is None:
             # pick the first available testament for testing
-            testament = self._files.keys()[0]
+            testament = list(self._files)[0]
             if self._module_type in (SwordModuleType.ZTEXT, SwordModuleType.ZTEXT4):
                 undecoded_text = self._uncompressed_text(testament, 0)
             else:
diff --git a/pysword/books.py b/pysword/books.py
index 47c1f78..cdc66cb 100644
--- a/pysword/books.py
+++ b/pysword/books.py
@@ -18,8 +18,12 @@
 # Franklin St, Fifth Floor, Boston, MA 02110-1301 USA                         #
 ###############################################################################
 
+import sys
+
 from pysword.canons import canons
 
+PY3 = sys.version_info > (3,)
+
 
 class BookStructure(object):
     def __init__(self, name, osis_name, preferred_abbreviation, chapter_lengths):
@@ -170,7 +174,8 @@ class BibleStructure(object):
             books = []
             for section in self._books:
                 books.extend([b.name for b in self._books[section]])
-        elif isinstance(books, str):
+        # It is needed to check for both str and unicode for python2 support
+        elif isinstance(books, str) or not PY3 and isinstance(books, unicode):
             books = [books]
 
         refs = {}
diff --git a/pysword/cleaner.py b/pysword/cleaner.py
index 0d7f2b2..b3b6fa9 100644
--- a/pysword/cleaner.py
+++ b/pysword/cleaner.py
@@ -69,6 +69,7 @@ class OSISCleaner(Cleaner):
         :param text: The text to be cleaned
         :return: The cleaned text is returned
         """
+        text = re.sub(r'(<[^\>]+type="x-br"[^\>]+\>)', r'\1 ', text)
         for regex in self.__remove_content_regexes:
             text = regex.sub(u'', text)
         for regex in self.__keep_content_regexes:
diff --git a/setup.py b/setup.py
index 052870d..c709c69 100644
--- a/setup.py
+++ b/setup.py
@@ -9,12 +9,12 @@ def read(filename):
 
 setup(
     name=u'pysword',
-    version=u'0.2.1',
+    version=u'0.2.3',
     packages=find_packages(exclude=[u'*.tests', u'*.tests.*', u'tests.*', u'tests']),
     url=u'https://gitlab.com/tgc-dk/pysword',
     license=u'GPL2',
     author=u'Tomas Groth',
-    author_email=u'tomasgroth at yahoo.dk',
+    author_email=u'second at tgc.dk',
     description=u'A native Python2/3 reader module for the SWORD Project Bible Modules',
     long_description=read(u'README.rst'),
     platforms=[u'any'],

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pysword.git



More information about the Python-modules-commits mailing list