This repository has been archived by the owner on Aug 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug outputting to Kobo. New options.
- Loading branch information
Alberto Pettarin
committed
Nov 29, 2015
1 parent
7e9df1c
commit 335292f
Showing
24 changed files
with
1,037 additions
and
652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.0.1 | ||
3.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ from penelope import main as package_main | |
__author__ = "Alberto Pettarin" | ||
__copyright__ = "Copyright 2012-2015, Alberto Pettarin (www.albertopettarin.it)" | ||
__license__ = "MIT" | ||
__version__ = "3.0.1" | ||
__version__ = "3.1.0" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
__author__ = "Alberto Pettarin" | ||
__copyright__ = "Copyright 2012-2015, Alberto Pettarin (www.albertopettarin.it)" | ||
__license__ = "MIT" | ||
__version__ = "3.0.1" | ||
__version__ = "3.1.0" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
__author__ = "Alberto Pettarin" | ||
__copyright__ = "Copyright 2012-2015, Alberto Pettarin (www.albertopettarin.it)" | ||
__license__ = "MIT" | ||
__version__ = "3.0.1" | ||
__version__ = "3.1.0" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,21 @@ | |
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
This is the default collation function (IcuNoCase) for bookeen output format. | ||
This is the default collation function (IcuNoCase). | ||
""" | ||
|
||
__author__ = "Alberto Pettarin" | ||
__copyright__ = "Copyright 2012-2015, Alberto Pettarin (www.albertopettarin.it)" | ||
__license__ = "MIT" | ||
__version__ = "3.0.1" | ||
__version__ = "3.1.0" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
||
def collate_function(string1, string2): | ||
""" | ||
Implement IcuNoCase collation. | ||
Implement default IcuNoCase collation, | ||
by simply lowercasing the UTF-8 encoded versions | ||
of the two strings. | ||
:param string1: first string | ||
:type string1: unicode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,27 @@ | |
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
This is a sample collation function (IcuNoCase) for German. | ||
This is a collation function (IcuNoCase) for German. | ||
""" | ||
|
||
__author__ = "Alberto Pettarin" | ||
__copyright__ = "Copyright 2012-2015, Alberto Pettarin (www.albertopettarin.it)" | ||
__license__ = "MIT" | ||
__version__ = "3.0.1" | ||
__version__ = "3.1.0" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
||
REPLACEMENTS = [ | ||
[u"ä", u"a"], | ||
[u"ö", u"o"], | ||
[u"ü", u"u"], | ||
[u"ß", u"ss"] | ||
] | ||
|
||
def collate_function(string1, string2): | ||
""" | ||
Implement IcuNoCase collation for German. | ||
(I do not remember where the procedure comes from.) | ||
:param string1: first string | ||
:type string1: unicode | ||
|
@@ -26,10 +34,9 @@ def collate_function(string1, string2): | |
b2 = string2.lower() | ||
c1 = b1 | ||
c2 = b2 | ||
for f in [[u"ä", u"a"], [u"ö", u"o"], [u"ü", u"u"], [u"ß", u"ss"]]: | ||
b1 = b1.replace(f[0], f[1]) | ||
b2 = b2.replace(f[0], f[1]) | ||
|
||
for repl in REPLACEMENTS: | ||
b1 = b1.replace(repl[0], repl[1]) | ||
b2 = b2.replace(repl[0], repl[1]) | ||
if b1.encode("utf-16") == b2.encode("utf-16"): | ||
if c1.encode("utf-16") == c2.encode("utf-16"): | ||
return 0 | ||
|
Oops, something went wrong.