07-10-2014, 11:23 PM | #61 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
IIRC PyQt auto converts the arguments for some fucntion calls. In any case getting a QBrush from a QColor is just
QBrush(QColor(whatever)) or QBrush(Qt.somecolorname) |
07-10-2014, 11:35 PM | #62 | |
Plugin Developer
Posts: 6,320
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
Another unrelated (and probably minor) issue: I've just noticed that the original plugin zip files from kiwidude I've been working on are zip files, but with 0% compression. I see that in some other plugins, too; but not all. Is/was there some reason for that? |
|
Advert | |
|
07-10-2014, 11:46 PM | #63 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Performance. Using zero compression means that the plugins files can be loaded faster as they dont need to be decompressed. If you use the recommended
calibre-customize -b . to build your plugins it will create zip files with no compression. |
07-10-2014, 11:54 PM | #64 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I have uploaded new beta builds (1.201) these include all the changes from todays main calibre release as well as fixes for all issues reported in this thread.
http://download.calibre-ebook.com/betas/ |
07-12-2014, 03:47 AM | #65 |
Bibliophagist
Posts: 35,428
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I've found an issue converting from .mobi to .epub. The conversion works with 1.44 but errors out with 1.201.1
Code:
Resolved conversion options calibre version: 1.201.1 {'asciiize': False, 'author_sort': None, 'authors': None, 'base_font_size': 0.0, 'book_producer': None, 'change_justification': u'original', 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., '\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', 'i')) or @class = 'chapter']", 'chapter_mark': u'pagebreak', 'comments': None, 'cover': u'C:\\Users\\David\\AppData\\Local\\Temp\\calibre_4zxfkr\\f0xlpt.jpeg', 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'dont_split_on_page_breaks': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'epub_flatten': False, 'epub_inline_toc': False, 'epub_toc_at_end': False, 'expand_css': False, 'extra_css': None, 'extract_to': None, 'filter_css': u'', 'fix_indents': True, 'flow_size': 260, 'font_size_mapping': None, 'format_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x0000000004ADD9E8>, 'insert_blank_line': False, 'insert_blank_line_size': 0.5, 'insert_metadata': False, 'isbn': None, 'italicize_common_cases': True, 'keep_ligatures': False, 'language': None, 'level1_toc': None, 'level2_toc': None, 'level3_toc': None, 'line_height': 0.0, 'linearize_tables': False, 'margin_bottom': 5.0, 'margin_left': 5.0, 'margin_right': 5.0, 'margin_top': 5.0, 'markup_chapter_headings': True, 'max_toc_links': 50, 'minimum_line_height': 120.0, 'no_chapters_in_toc': False, 'no_default_epub_cover': False, 'no_inline_navbars': False, 'no_svg_cover': False, 'output_profile': <calibre.customize.profiles.KoboReaderOutput object at 0x0000000004AF20B8>, 'page_breaks_before': u"//*[name()='h1' or name()='h2']", 'prefer_metadata_cover': False, 'preserve_cover_aspect_ratio': True, 'pretty_print': True, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'C:\\Users\\David\\AppData\\Local\\Temp\\calibre_4zxfkr\\snb04d.opf', 'remove_fake_margins': True, 'remove_first_image': False, 'remove_paragraph_spacing': False, 'remove_paragraph_spacing_indent_size': 1.5, 'renumber_headings': True, 'replace_scene_breaks': u'', 'search_replace': '[]', 'series': None, 'series_index': None, 'smarten_punctuation': False, 'sr1_replace': None, 'sr1_search': None, 'sr2_replace': None, 'sr2_search': None, 'sr3_replace': None, 'sr3_search': None, 'start_reading_at': None, 'subset_embedded_fonts': False, 'tags': None, 'timestamp': None, 'title': None, 'title_sort': None, 'toc_filter': None, 'toc_threshold': 6, 'toc_title': None, 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'verbose': 2} InputFormatPlugin: MOBI Input running on C:\Users\David\AppData\Local\Temp\calibre_4zxfkr\99h3z4.mobi Extracting text... Adding anchors... Extracting images... Cleaning up HTML... Parsing HTML... Converting style information to CSS... Creating OPF... Parsing all content... Parsing styles.css ... Parsing index.html ... Forcing index.html into XHTML namespace Reading TOC from NCX... Merging user specified metadata... Detecting structure... Flattening CSS and remapping font sizes... Source base font size is 12.00000pt Removing fake margins... Found 45 items of level: div_1 Found 10 items of level: p_4 Found 4926 items of level: p_1 Ignoring level p_4 div_1 left margin stats: Counter() div_1 right margin stats: Counter() p_1 left margin stats: Counter({u'0': 4926}) p_1 right margin stats: Counter({u'0': 4926}) Cleaning up manifest... Trimming unused files from manifest... Trimming u'images/00008.jpg' from manifest Trimming u'images/00009.jpg' from manifest Creating EPUB Output... Python function terminated unexpectedly local variable 'args' referenced before assignment (Error Code: 1) Traceback (most recent call last): File "site.py", line 132, in main File "site.py", line 109, in run_entry_point File "site-packages\calibre\utils\ipc\worker.py", line 195, in main File "site-packages\calibre\gui2\convert\gui_conversion.py", line 31, in gui_convert_override File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert File "site-packages\calibre\ebooks\conversion\plumber.py", line 1194, in run File "site-packages\calibre\ebooks\conversion\plugins\epub_output.py", line 192, in convert File "site-packages\calibre\ebooks\oeb\transforms\rescale.py", line 21, in __call__ File "site-packages\calibre\gui2\__init__.py", line 1057, in is_ok_to_use_qt File "site-packages\calibre\gui2\__init__.py", line 1049, in must_use_qt UnboundLocalError: local variable 'args' referenced before assignment Regards, David Last edited by DNSB; 07-12-2014 at 03:53 AM. |
Advert | |
|
07-12-2014, 03:49 AM | #66 | |
Grand Sorcerer
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
|
|
07-12-2014, 04:35 AM | #67 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@DNSB: Ah that bug affects conversions on non-linux platforms. I have committed a fix and I will upload 1.201.2 in a little while with the fix since it is a fairly severe bug.
https://github.com/kovidgoyal/calibr...fbf612d961ef50 |
07-12-2014, 05:19 AM | #68 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I have uploaded 1.201.2 with the fix for the issue reported by DNSB
|
07-12-2014, 05:44 AM | #69 | |
Bibliophagist
Posts: 35,428
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Edit: downloaded and installed the update and tried several conversions. All went fine! Regards, David Last edited by DNSB; 07-12-2014 at 05:53 AM. Reason: update |
|
07-12-2014, 09:45 AM | #70 |
Grand Sorcerer
Posts: 27,550
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Having trouble with a personal (inherited) plugin that has a lot of the following calls
Code:
return unicode(self.lineedit.text().toUtf8(), 'utf8').strip() Code:
unicode object has no toUtf8 attribute Code:
return unicode(self.lineedit.text()).strip() **NOTE: these values from the QLineEdit objects may contain non-ascii characters and will eventually be saved/retrieved in/from the plugin's JSON prefs file if that has any bearing at all. |
07-12-2014, 10:40 AM | #71 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
return unicode(self.lineedit.text()).strip()
will do the right thing in both Qt 4 and Qt 5 |
07-12-2014, 10:41 AM | #72 |
Well trained by Cats
Posts: 29,804
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Ninja'd by Kovid
Last edited by theducks; 07-12-2014 at 10:42 AM. Reason: never mind |
07-12-2014, 10:58 AM | #73 |
Grand Sorcerer
Posts: 27,550
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
07-12-2014, 06:30 PM | #74 | |
Grand Sorcerer
Posts: 27,550
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Code:
ans = QFileDialog.getOpenFileName(self, mycaption, mydir, myfilter) selfile = ans[0] if isinstance(ans, tuple) else ans if selfile: do-stuff with selfile Last edited by DiapDealer; 07-12-2014 at 06:34 PM. |
|
07-12-2014, 06:48 PM | #75 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
@DiapDealer,
Thanks for that Certainly less wordy than mine. I think I'll try your way. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
calibre-plugins.com: A resource for plugin developers | GRiker | Development | 2 | 11-19-2014 03:52 PM |
Thank you to Calibre Developers | Happy_Reader | Calibre | 1 | 12-17-2013 10:18 PM |
Thanks Calibre Developers! | TechniSol | Kobo Reader | 3 | 11-19-2012 08:34 PM |
Calibre in a Python 3.2 world, attn: Kovid | Kevin McAleavey | Calibre | 8 | 01-09-2012 05:49 PM |
What device do most calibre developers use? | barium | Calibre | 5 | 01-05-2011 07:23 AM |