|
|
#61 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
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) |
|
|
|
|
|
#62 | |
|
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,141
Karma: 5005503
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
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 | |
|
|
|
|
#63 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
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. |
|
|
|
|
|
#64 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
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/ |
|
|
|
|
|
#65 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48,213
Karma: 174315444
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, 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 04:53 AM. |
|
|
|
| Advert | |
|
|
|
|
#66 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,687
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
|
|
|
|
|
|
|
#67 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
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 |
|
|
|
|
|
#68 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I have uploaded 1.201.2 with the fix for the issue reported by DNSB
|
|
|
|
|
|
#69 | |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48,213
Karma: 174315444
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, 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 06:53 AM. Reason: update |
|
|
|
|
|
|
#70 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,893
Karma: 207182180
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. |
|
|
|
|
|
#71 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609
Karma: 28549044
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 |
|
|
|
|
|
#72 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,270
Karma: 61916422
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 11:42 AM. Reason: never mind |
|
|
|
|
|
#73 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,893
Karma: 207182180
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
|
|
|
|
|
#74 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,893
Karma: 207182180
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 07:34 PM. |
|
|
|
|
|
|
#75 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,269
Karma: 16544702
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
@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 04:52 PM |
| Thank you to Calibre Developers | Happy_Reader | Calibre | 1 | 12-17-2013 11:18 PM |
| Thanks Calibre Developers! | TechniSol | Kobo Reader | 3 | 11-19-2012 09:34 PM |
| Calibre in a Python 3.2 world, attn: Kovid | Kevin McAleavey | Calibre | 8 | 01-09-2012 06:49 PM |
| What device do most calibre developers use? | barium | Calibre | 5 | 01-05-2011 08:23 AM |