From 6a8b4f9a21605ffe06a6ca4c8cb5263954eccb60 Mon Sep 17 00:00:00 2001 From: GRiker Date: Fri, 22 Jan 2010 11:36:24 -0700 Subject: [PATCH 1/2] GwR diagnostic for KG crash --- src/calibre/gui2/catalog/catalog_epub_mobi.ui | 39 +++++++++++++++---- src/calibre/library/catalog.py | 1 + 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/calibre/gui2/catalog/catalog_epub_mobi.ui b/src/calibre/gui2/catalog/catalog_epub_mobi.ui index f8a515e4ec..9714df1e63 100644 --- a/src/calibre/gui2/catalog/catalog_epub_mobi.ui +++ b/src/calibre/gui2/catalog/catalog_epub_mobi.ui @@ -17,7 +17,7 @@ 20 - 20 + 70 241 21 @@ -36,7 +36,7 @@ 20 - 50 + 100 241 17 @@ -49,7 +49,7 @@ 20 - 110 + 160 171 17 @@ -62,7 +62,7 @@ 300 - 20 + 70 231 22 @@ -78,7 +78,7 @@ 300 - 50 + 100 231 22 @@ -94,7 +94,7 @@ 300 - 80 + 130 231 22 @@ -110,7 +110,7 @@ 20 - 80 + 130 241 17 @@ -123,7 +123,7 @@ 300 - 110 + 160 231 22 @@ -135,6 +135,29 @@ * + + + + 61 + 20 + 461 + 20 + + + + + 14 + 75 + true + + + + Special Tags for Catalog Creation + + + Qt::AlignCenter + + diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index 44431e73fe..88709f1e18 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -2453,6 +2453,7 @@ class EPUB_MOBI(CatalogPlugin): for (i,word) in enumerate(title_words): hit = re.search('[0-9]+',word) if hit : + print "library.catalog:CatalogBuilder.generateSortTitle(): translating '%s'" % word translated.append(EPUB_MOBI.NumberToText(word).text) else: translated.append(word) From bd39c9edb4b3514f308bd95b5b631eb80605db25 Mon Sep 17 00:00:00 2001 From: GRiker Date: Fri, 22 Jan 2010 13:17:06 -0700 Subject: [PATCH 2/2] GwR fixed colon bug in NumberTranslate --- src/calibre/gui2/catalog/catalog_epub_mobi.ui | 148 ------------------ src/calibre/library/catalog.py | 6 +- 2 files changed, 4 insertions(+), 150 deletions(-) diff --git a/src/calibre/gui2/catalog/catalog_epub_mobi.ui b/src/calibre/gui2/catalog/catalog_epub_mobi.ui index 2d08aeed52..e683c479bf 100644 --- a/src/calibre/gui2/catalog/catalog_epub_mobi.ui +++ b/src/calibre/gui2/catalog/catalog_epub_mobi.ui @@ -13,153 +13,6 @@ Form -<<<<<<< TREE - - - - 20 - 70 - 241 - 21 - - - - Tags to exclude as genres (regex): - - - Qt::LogText - - - true - - - - - - 20 - 100 - 241 - 17 - - - - 'Don't include this book' tag: - - - - - - 20 - 160 - 171 - 17 - - - - Additional note tag prefix: - - - - - - 300 - 70 - 231 - 22 - - - - - - - \[[\w ]*\] - - - - - - 300 - 100 - 231 - 22 - - - - - - - ~ - - - - - - 300 - 130 - 231 - 22 - - - - - - - + - - - - - - 20 - 130 - 241 - 17 - - - - 'Mark this book as read' tag: - - - - - - 300 - 160 - 231 - 22 - - - - - - - * - - - - - - 61 - 20 - 461 - 20 - - - - - 14 - 75 - true - - - - Special Tags for Catalog Creation - - - Qt::AlignCenter - - -======= @@ -237,7 +90,6 @@ ->>>>>>> MERGE-SOURCE diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index 6af2a8eb93..dbcf2df679 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -375,7 +375,10 @@ class EPUB_MOBI(CatalogPlugin): self.text = ''.join(result) else: - number = int(self.number) + try: + number = int(self.number) + except: + return if number > 1000000: self.text = "%d out of range" % number @@ -2449,7 +2452,6 @@ class EPUB_MOBI(CatalogPlugin): for (i,word) in enumerate(title_words): hit = re.search('[0-9]+',word) if hit : - print "library.catalog:CatalogBuilder.generateSortTitle(): translating '%s'" % word translated.append(EPUB_MOBI.NumberToText(word).text) else: translated.append(word)