Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 11-21-2020, 09:28 AM   #226
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
@thosp: Thank you for letting me know about this bug. This has been fixed and the updated plugin has been put in the first post of this thread.
CalibUser is offline   Reply With Quote
Old 05-24-2021, 08:44 AM   #227
thosp
Member
thosp began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2014
Device: laptop & tablet
Incorrect Character Change

Greetings,

I ran the plugin against a file containing, "Texta / Textb"

and it changed it to, "Texta I Textb".

That is incorrect, isn't it?
thosp is offline   Reply With Quote
Advert
Old 05-25-2021, 05:25 AM   #228
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Quote:
Originally Posted by thosp View Post
I ran the plugin against a file containing, "Texta / Textb"

and it changed it to, "Texta I Textb".

That is incorrect, isn't it?
@thosp: The plugin is not perfect and a number of assumptions were made for changing text/symbols that may seem to be incorrect.

The plugin assumes that a "/" separated by two spaces should be the letter "I" as this was one of the frequent errors in ePub files that were converted from pdf files. It will not change a "/" if it is not surrounded by spaces.

So although the plugin is amending "Texta / Textb" incorrectly, it is making the change that it was programmed to do. If I amend the code to ignore " / " then it will not detect any " / "s that should be an "I".

It is not possible to amend the plugin so that it can work out whether a " / " should be changed to "I" or not. On balance, I will leave the plugin to change " / " to "I" as "I" in the pdf is commonly converted to "/" in the ePub.
CalibUser is offline   Reply With Quote
Old 05-25-2021, 10:27 AM   #229
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
One idea is to do what Doitsu does in many of his plugins which is to use the plugins Prefs to store user-editable preferences so that the user can enable that change or not.
KevinH is offline   Reply With Quote
Old 05-26-2021, 05:55 AM   #230
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Quote:
Originally Posted by KevinH View Post
...use the plugins Prefs to store user-editable preferences so that the user can enable that change or not.
Thanks for the suggestion. However, for some changes this would be long-winded to implement. In the worse case situation I would have to split up the following code to allow each term to be selected/rejected:

Code:
	if cDetermineQuotes.OpenQ == "‘":
		CorrectText("Corrected apostrophes in wrong direction", r'[ ]?‘(ad|ave|bout|eard|em|er|cause|cept|im|is|old|ome|ow|specially|Taint|til|tis|twas)(\W?)', r' ’\1\2')
	else:
		CorrectText("Corrected apostrophes in wrong direction", r'[ ]?‘(?i)(\d\d|ad[n]{0,1}|app[yines]{0,5}|appen[eds]{0,2}|ard[er]{0,2}|arf|alf|ang|as|at|av[ein]{0,3}|bout|bye|cause|cept[ing]{0,3}|copter[s]{0,1}|cos|cross|cuz|couse|e[emr]{0,1}|ell|elp[edling]{0,5}|ere[abouts]{0,5}|eard|f|fraid|fore|id|igh[er]{0,2}|ighness|im|is|isself|gainst|kay|less|mongst| n|nd|neath|nough|nother|nuff|o[o]{0,1}|ood|ome|ow|op[eding]{0,3}|oney|orse[flesh]{0,5}|ouse[ds]{0,1}|pon|puter[edrs]{0,2}|round|scuse[ds]{0,1}|spect[sed]{0,2}|scaped|sides|tween|special[ly]{0,2}|stead|t|taint|til|tis|twas|twere|twould|twil l|ud|un|urt|vise)(\W?)', r' ’\1\2')
However, if enough users want this feature then I will consider it.
CalibUser is offline   Reply With Quote
Advert
Old 05-28-2021, 08:56 PM   #231
democrite
Evangelist
democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.democrite will give the Devil his due.
 
Posts: 425
Karma: 77256
Join Date: Sep 2011
Device: none
I understand such would require a fair amount of work. As I believe I suggested something like such before, someday yes, yes I say yes.
democrite is offline   Reply With Quote
Old 02-24-2022, 05:10 PM   #232
thosp
Member
thosp began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Dec 2014
Device: laptop & tablet
Error Message

I ran the plugin, and got the following and am buffaloed. I have previously used this plugin with very few problems. Now I've deleted, got new one fresh from here, installed - TWICE - and no help. Any ideas, please!

Status: failed

Python Laucher Version: 20220101
Checking for updates...
Published version 3.0.1.4
Installed version 3.0.1.4
You have the latest version of this plugin
You have the latest version of this plugin
Will check for updates/remind update is available at: 2022-02-25 15:59:40.670795
Traceback (most recent call last):
File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 142, in launch
self.exitcode = target_script.run(container)
File "C:\Users\thosp\AppData\Local\sigil-ebook\sigil\plugins\ePubTidyTool\plugin.py", line 375, in run
ShowMainWindow(root, bk, prefs) #show the main window
File "C:\Users\thosp\AppData\Local\sigil-ebook\sigil\plugins\ePubTidyTool\plugin.py", line 230, in ShowMainWindow
mainframe = ttk.Frame(root, padding="15 15 12 12")
NameError: name 'ttk' is not defined
Error: name 'ttk' is not defined
thosp is offline   Reply With Quote
Old 02-25-2022, 12:08 AM   #233
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by thosp View Post
I ran the plugin, and got the following and am buffaloed. I have previously used this plugin with very few problems. Now I've deleted, got new one fresh from here, installed - TWICE - and no help. Any ideas, please!
There's a bug in the plugin, which you can easily fix yourself.
Select Edit > Open Preferences Location > plugins > ePubTidyTool.
Open plugin.py with a text editor and change line 12 from:
Code:
import tkinter.ttk as tkinter_ttk	#Essential for ttk. commands
to:

Code:
import tkinter.ttk as ttk	#Essential for ttk. commands
Doitsu is offline   Reply With Quote
Old 02-25-2022, 03:54 AM   #234
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Thanks, Doitsu.

I have updated the first post in this thread with your correction.
CalibUser is offline   Reply With Quote
Old 04-17-2022, 01:57 AM   #235
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Hi

I am having problems with the plugin and would appreciate any heelp.

I have used the plugin for years as I find it very useful although I could never get the resize image funtion to work. This was not an issue as I used other ways to do this.

Just recently I had my PC in for repairs and when I got it back had to reinstall Sigil, Calibre and the plugins I use for both.

Since then I cannot get the "process spans" feature in epubtidy to work. I have deleted the plugin and its preferences several times but get the same result,

A box that contains the following text appears

Python Laucher Version: 20220310
Will check for updates/remind update is available at: 2022-04-18 12:27:16.739346


folowed by the appearance of a small blank box labelled Epubtidy which has a feather icon in the top left corner.

I have left these boxes on screen for over 30 minutes and nothing appears to happen.

I liked the process spans feature and would like to get it working again.

Thanks

the a

Last edited by Thasaidon; 04-17-2022 at 01:59 AM. Reason: grammar
Thasaidon is offline   Reply With Quote
Old 04-17-2022, 07:41 AM   #236
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Thasaidon View Post
I am having problems with the plugin and would appreciate any help.
There's a bug in the plugin, which you can easily fix yourself. Select Edit > Open Preferences Location > plugins > ePubTidyTool.
Open SpanTagProcessor.py with a text editor and change line 9 from:
Code:
import tkinter.ttk as tkinter_ttk	#Essential for ttk. commands
to:

Code:
import tkinter.ttk as ttk	#Essential for ttk. commands
If you encounter other problems, replace the same line in all other .py files in that folder.
Doitsu is offline   Reply With Quote
Old 04-17-2022, 09:38 PM   #237
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 800
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by Doitsu View Post
Code:
import tkinter.ttk as tkinter_ttk	#Essential for ttk. commands
to:

Code:
import tkinter.ttk as ttk	#Essential for ttk. commands
If you encounter other problems, replace the same line in all other .py files in that folder.
That cured it Doitsu. Thank you very much.

I must have done this in the past but had forgotten all about doing it.

I looked through the other py files abd spotted why the Resize Image function never worked. Apparently it needs the Pillow graphics library to be installed. Something I had not noticed before.
Thasaidon is offline   Reply With Quote
Old 04-18-2022, 05:55 AM   #238
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Update

Thanks for pointing out this bug and how it should be corrected.

I have updated the plugin in the first post of this thread so that

Code:
import tkinter.ttk as tkinter_ttk
is replaced by

Code:
import tkinter.ttk as ttk
in all relevant files in the plugin.
CalibUser is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tidying Up My Kindle selectortone Calibre 2 07-17-2013 10:35 AM
developping a Plugin for Presentation files abdlink Plugins 4 04-15-2013 11:27 AM
Plugin to fix fb2 files oviksna Plugins 3 01-28-2013 08:53 AM
Tidying Up My Library JayLaFunk Library Management 2 09-20-2011 09:12 AM
Calibre 0.7.50 can't see plugin files mb_webguy Calibre 5 04-29-2011 03:41 AM


All times are GMT -4. The time now is 11:46 PM.


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