Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 07-27-2014, 10:20 AM   #76
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Am I missing something on the debugging side of things? I can't get print commands to show up in the calibre-debug -g console (Windows). Nor can I get them to print to a console when launching ebook-edit as a stand-alone. The plugins are working, though. I'm sure I'm missing something obvious. There has to be a way to quickly debug without popping up Qt messageboxes everywhere, right?
DiapDealer is offline   Reply With Quote
Old 07-27-2014, 01:24 PM   #77
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre-debug --edit-book
kovidgoyal is offline   Reply With Quote
Old 07-27-2014, 03:53 PM   #78
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Thanks a bunch!
DiapDealer is offline   Reply With Quote
Old 07-27-2014, 04:21 PM   #79
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,234
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by davidfor View Post
I didn't think of that at all when I started. It was only after rereading one of the posts that I thought


I haven't thought about sort algorithms for a VERY long time. I'll have a think of these options.

In the meantime, I have added the single file sort that has been suggested. The toolbar button now has a menu option "Sort current file". When that is checked, pressing the button will sort the currently opened file if it is a stylesheet. If it is not checked, it will sort all of them as it does now.
This release doesn't appear at the toolbar, and when I try to add it, I have the following error:

Spoiler:
calibre, version 1.46.0
ERROR: Excepción no considerada: <b>UnboundLocalError</b>:local variable 'ac' referenced before assignment

calibre 1.46 isfrozen: True is64bit: False
Windows-7-6.1.7600 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '7', '6.1.7600')
Python 2.7.5
Windows: ('7', '6.1.7600', '', 'Multiprocessor Free')
Traceback (most recent call last):
File "site-packages\calibre\gui2\tweak_book\preferences.py", line 452, in bar_changed
File "site-packages\calibre\gui2\tweak_book\preferences.py", line 447, in build_lists
UnboundLocalError: local variable 'ac' referenced before assignment


And I only have an option: SortCss, which applies only to a current file.

BTW, if the styles are defined as p.tx1 instead of .tx1 into the css file, there's an error too at the plugin.

Last edited by Terisa de morgan; 07-27-2014 at 04:35 PM.
Terisa de morgan is offline   Reply With Quote
Old 07-27-2014, 09:09 PM   #80
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Terisa de morgan View Post
This release doesn't appear at the toolbar, and when I try to add it, I have the following error:

Spoiler:
calibre, version 1.46.0
ERROR: Excepción no considerada: <b>UnboundLocalError</b>:local variable 'ac' referenced before assignment

calibre 1.46 isfrozen: True is64bit: False
Windows-7-6.1.7600 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '7', '6.1.7600')
Python 2.7.5
Windows: ('7', '6.1.7600', '', 'Multiprocessor Free')
Traceback (most recent call last):
File "site-packages\calibre\gui2\tweak_book\preferences.py", line 452, in bar_changed
File "site-packages\calibre\gui2\tweak_book\preferences.py", line 447, in build_lists
UnboundLocalError: local variable 'ac' referenced before assignment


And I only have an option: SortCss, which applies only to a current file.
Yes, that's my fault. See my response theducks for how to fix.
Quote:
BTW, if the styles are defined as p.tx1 instead of .tx1 into the css file, there's an error too at the plugin.
I have one of those in the standard stylesheet I use and it is sorting without errors. Can you post the error?
davidfor is offline   Reply With Quote
Old 07-28-2014, 12:49 AM   #81
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,234
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by davidfor View Post
Yes, that's my fault. See my response theducks for how to fix.
There's no error now, but the plugin doesn't appear either. Is that normal or I'm doing something wrong?

Quote:
Originally Posted by davidfor View Post
I have one of those in the standard stylesheet I use and it is sorting without errors. Can you post the error?
This is one of them (Perhaps comment are the problem? )

Spoiler:
calibre, version 1.46.0
ERROR: Failed to sort the CSS: Failed to sort the CSS, click "Show details" for more info

Traceback (most recent call last):
File "calibre_plugins.sortcss.main", line 83, in sort_stylesheets
File "calibre_plugins.sortcss.main", line 117, in sort_stylesheet
File "calibre_plugins.sortcss.main", line 117, in <lambda>
AttributeError: 'CSSComment' object has no attribute 'selectorText'
Terisa de morgan is offline   Reply With Quote
Old 07-28-2014, 03:50 AM   #82
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Terisa de morgan View Post
There's no error now, but the plugin doesn't appear either. Is that normal or I'm doing something wrong?
It doesn't appear on the toolbar or it doesn't appear when you configure the toolbar? For the former, open the preferences and configure the toolbar. For the latter, uninstall the plugin and edit the file I mentioned. The install the plugin again.
Quote:
This is one of them (Perhaps comment are the problem? )

Spoiler:
calibre, version 1.46.0
ERROR: Failed to sort the CSS: Failed to sort the CSS, click "Show details" for more info

Traceback (most recent call last):
File "calibre_plugins.sortcss.main", line 83, in sort_stylesheets
File "calibre_plugins.sortcss.main", line 117, in sort_stylesheet
File "calibre_plugins.sortcss.main", line 117, in <lambda>
AttributeError: 'CSSComment' object has no attribute 'selectorText'
That isn't caused by the "p.txt1" and ".txt1" rules. That is because I am using a extremely simple sort algorithm that didn't take into account the fact that some types of styles didn't have selectors. And it definitely didn't take into account that the comments were considered to be styles.

I am working on a better sort methods. The first pass will be to sort those that can be sorted by selector and put them after all the ones that can't be sorted. Then, I'll look at something a little more intelligent.
davidfor is offline   Reply With Quote
Old 07-28-2014, 03:53 AM   #83
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,234
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by davidfor View Post
It doesn't appear on the toolbar or it doesn't appear when you configure the toolbar? For the former, open the preferences and configure the toolbar. For the latter, uninstall the plugin and edit the file I mentioned. The install the plugin again.
I was doing something wrong, yes. No uninstall / install.


Quote:
Originally Posted by davidfor View Post
That isn't caused by the "p.txt1" and ".txt1" rules. That is because I am using a extremely simple sort algorithm that didn't take into account the fact that some types of styles didn't have selectors. And it definitely didn't take into account that the comments were considered to be styles.

I am working on a better sort methods. The first pass will be to sort those that can be sorted by selector and put them after all the ones that can't be sorted. Then, I'll look at something a little more intelligent.
Ok, thank you very much. Now I know the problem, I'll remove the comments and that's all (not very useful for me, really).
Terisa de morgan is offline   Reply With Quote
Old 08-01-2014, 04:38 PM   #84
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Just noticed that something isn't getting cleaned up when uninstalling editor plugins. I only noticed it when I changed one of my "Tool" class names in main.py and reinstalled the plugin. Same thing happens on a simple uninstall though, too.

When running calibre-debug --edit-book, I get warnings about those missing "Tool" names. like:
Code:
Unknown action for toolbar u'plugins-bar': u'Diaps Editing ToolbagSpanDivEdittoolbar'
I can find those entries and remove them from the "tweak_book_gui.json" file in the config directory easily enough, but didn't know if it might affect something else.

Last edited by DiapDealer; 08-01-2014 at 05:46 PM.
DiapDealer is offline   Reply With Quote
Old 08-01-2014, 11:48 PM   #85
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Those messages are harmless. Uninstalling does not remove the entries for the toolbar so that if you re-install they are still there, in the chosen location. The editor simply ignores missing actions.
kovidgoyal is offline   Reply With Quote
Old 08-03-2014, 11:02 AM   #86
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
This has made me think a little bit about plugins in the Editor.

I believe Editor plugins should really have their own management, from the Editor preferences. Not only does it allow you to handle the entire Editor workflow directly through the Editor, I know there are people who only use calibre for the editor and do not touch the library GUI at all. I don't think it makes sense to force them into the library so they can add plugins to the editor.

Ideally, each standalone component of calibre should handle all its settings internally, rather than tying back to the library for some things -- that is why all the rest of Preferences is internal to the editor component already.

Kovid, when you get a chance, can you separate this?
eschwartz is offline   Reply With Quote
Old 08-03-2014, 11:08 AM   #87
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,810
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by eschwartz View Post
This has made me think a little bit about plugins in the Editor.

I believe Editor plugins should really have their own management, from the Editor preferences. Not only does it allow you to handle the entire Editor workflow directly through the Editor, I know there are people who only use calibre for the editor and do not touch the library GUI at all. I don't think it makes sense to force them into the library so they can add plugins to the editor.

Ideally, each standalone component of calibre should handle all its settings internally, rather than tying back to the library for some things -- that is why all the rest of Preferences is internal to the editor component already.

Kovid, when you get a chance, can you separate this?
I suggested that, Kovid said NO

But, then Kovid is also inconsistent in that you don't see 'Editor' settings in the Main Preferences (A user was confused because they could not find the setting we were saying to change, which is why I mention it). Kovid, can we have Editor (and Viewer, to be consistent) preference setting Icons in the Miscellaneous ??? section of Preferences?

Last edited by theducks; 08-03-2014 at 11:47 AM. Reason: was not a section
theducks is online now   Reply With Quote
Old 08-03-2014, 11:15 AM   #88
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by theducks View Post
I suggested that, Kovid said NO

But, then Kovid is also inconsistent in that you don't see 'Editor' settings in the Main Preferences (A user was confused because they could not find the setting we were saying to change, which is why I mention it). Kovid, can we have Editor (and Viewer, to be consistent) preference setting Icons in the Miscellaneous section of Preferences?

I am an optimist -- perhaps it is simply not a priority but he would agree to get around to it when he gets a chance. I am not sure what the argument against it as a good thing would be, although I can see it not being very critical and perhaps being too much work ATM.

I do think it should be all or nothing. Inconsistency .

Last edited by eschwartz; 08-03-2014 at 11:17 AM.
eschwartz is offline   Reply With Quote
Old 08-03-2014, 11:22 AM   #89
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@eschwartz: Patches welcome.
kovidgoyal is offline   Reply With Quote
Old 08-03-2014, 11:54 AM   #90
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I guess I just don't see the issue. You have to download and install all of calibre to use any of these addons, so why would it be such a hardship for someone to use the main gui to install these addons? It's just the one time (per plugin) and then you can go back to ignoring main program if you like.

It's no real skin off my nose either way, but it just seems sort of pointless to me to focus on plugin framework isolation when the various pieces (library, converter, viewer, editor) share way too many resource to ever be truly independent of each other anyway. Not to mention the inefficiency of maintaining separate plugin frameworks from a code-base perspective.

The way I figure it: if you just want to just use some of calibre's features independently ... have at it. But when it comes time to extend those features with third party tools ... it's not that outrageous that we're expected to return to "home base" to do so. *shrug*
DiapDealer is offline   Reply With Quote
Reply


Forum Jump


All times are GMT -4. The time now is 07:41 PM.


MobileRead.com is a privately owned, operated and funded community.