Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-18-2019, 10:25 AM   #211
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 850
Karma: 3341026
Join Date: Jan 2017
Location: Poland
Device: Various
Sure. I meant, of course, one window with two columns.
BeckyEbook is offline   Reply With Quote
Old 11-18-2019, 10:38 AM   #212
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: 8,848
Karma: 6120478
Join Date: Nov 2009
Device: many
I will give it a shot.
KevinH is online now   Reply With Quote
Old 11-18-2019, 10:55 AM   #213
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: 28,648
Karma: 205022288
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
That should be quite doable. Would this be better, or are regular expressions too hard for most users needs?
I figure the ones that regex is too difficult for probably won't be engaging in much mass-renaming anyway. And there's always the auto-numbering version with the base prefix for those ones.

Just remember to leave the extension out of the new feature. Don't you think? We already have a way of changing the extension on the xhtml files en masse.

How do plan to handle potential duplicate names with RE renamer? Should the entire process fail without edits if any are found? Or would you run a check before the preview to ensure viability of all names in advance?
DiapDealer is offline   Reply With Quote
Old 11-18-2019, 11:11 AM   #214
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: 31,098
Karma: 60358908
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 DiapDealer View Post

How do plan to handle potential duplicate names with RE renamer? Should the entire process fail without edits if any are found? Or would you run a check before the preview to ensure viability of all names in advance?
I lean towards a method that needs the least steps.:
How many times will it use FAIL? Why make a 2 step process for a small percentage of cases? Fail those and run with the norm.

BTW I am just curious. I don't ever remember seeing a crazy long suffix file name. The prefix part...
Is this more common for other than, English language fiction (which is all I can read )?
theducks is offline   Reply With Quote
Old 11-18-2019, 11:29 AM   #215
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 850
Karma: 3341026
Join Date: Jan 2017
Location: Poland
Device: Various
Hmmm ...
Maybe you really don't need to add such a function to Sigil.
If it concerns only users per mil, it will be more valuable to add such a possibility to plugins, without multiplying the function to change the name.
BeckyEbook is offline   Reply With Quote
Old 11-18-2019, 11:45 AM   #216
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: 8,848
Karma: 6120478
Join Date: Nov 2009
Device: many
I will give it a try. It will first pop up a Dialog that will ask for Regular Expression and Replacement.

With that it will build a list of before and after filenames for the user to accept or reject.

If accepted, it will check that the future bookpaths are unique before allowing the rename to proceed.

That is the plan anyway. If no one likes it, I can easily dumb it down to make a PrefixTrimmer instead.
KevinH is online now   Reply With Quote
Old 11-18-2019, 12:32 PM   #217
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: 28,648
Karma: 205022288
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by theducks View Post
How many times will it use FAIL? Why make a 2 step process for a small percentage of cases? Fail those and run with the norm.
I don't think you appreciate what "failing" the renaming of a file in Sigil could entail. A mass rename is also a mass updating of all hrefs within the epub.

Way better in my opinion, to know before-hand whether there's potential problems and not let the user proceed with the mass rename if there is.
DiapDealer is offline   Reply With Quote
Old 11-18-2019, 01:43 PM   #218
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,834
Karma: 8006102
Join Date: Mar 2015
Device: Kindle, iOS
I didn't mean to open a can of worms. I was really asking a question about existing features, not making a request for a new one!
odamizu is offline   Reply With Quote
Old 11-18-2019, 01:53 PM   #219
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by KevinH View Post
Then it could produce a list of before and after filenames side by side and have OK and CANCEL buttons.
Yes, that sounds fantastic.

Side-by-side Before/Afters would be nice.

As an example, I use Bulk Rename Utility:

Click image for larger version

Name:	Bulk.Rename.Utility.Example.png
Views:	118
Size:	33.4 KB
ID:	175011

and it shows any files that are being changed as green. And any options that are going to be applied with an orange box.

* * *

I think having a Default/Advanced Mode for Sigil's Bulk Rename would work.

Default would be similar to how it is now, except you get a few extra "basic options":
  • Remove
    • First n
    • Last n
    • Note: Takes numbers only. Chops off the characters (not counting extension).
  • Add
    • Prefix
    • Suffix
    • Note: Takes a string. Adds it before/after the filename.
  • Change Extension To (?)
    • (Maybe this could be a separate string box?)
    • Currently, this is a "hidden" feature of Sigil. If you type "ReplaceText", it only changes filename, but if you type "ReplaceText.xhtml", the extension gets changed too.

Quote:
Originally Posted by KevinH View Post
That should be quite doable. Would this be better, or are regular expressions too hard for most users needs?
Maybe Advanced enables you to then use Regex (just a little checkbox toggle? Or maybe the same 3 Mode dropdown as Sigil's Ctrl+F?).

Side Note: Kind of reminds me of Thunar's bulk rename. That regex support was so great to have built directly into the file manager!

https://www.ghacks.net/2009/07/22/bu...-bulk-renamer/

Last edited by Tex2002ans; 11-18-2019 at 01:56 PM.
Tex2002ans is offline   Reply With Quote
Old 11-18-2019, 02:07 PM   #220
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: 8,848
Karma: 6120478
Join Date: Nov 2009
Device: many
I have taken a shot at this. I have pushed a very simple, very basic working version to master.

See the BookBrowser context menu for RE Renamer. You highlight the resources you want to rename first.

It requests your regex string and your replacement text.

Then it shows you what the results would be. If you accept, it does the actual renaming.

Some things:
  • This is for testing purposes and feedback, there is no guarantee this feature will be kept.
  • You need to escape a ( as \( to prevent it from being part of a group.
  • You will not need to escape \s
  • Replacement groups need to look like \1
  • The testing for duplicate filenames is done on a file by file basis and no renames will be done on files that create duplicate bookpaths

So it is not pretty but it should be usable. If people think it should stay we can try a better way to handle the escaping for the backslash character.

Feedback welcome!

Last edited by KevinH; 11-18-2019 at 03:16 PM.
KevinH is online now   Reply With Quote
Old 11-18-2019, 02:45 PM   #221
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 850
Karma: 3341026
Join Date: Jan 2017
Location: Poland
Device: Various
The first tests are very promising.
Strength in simplicity!

Only one thing - after pressing "Cancel" in the prior-revised window could return to the window with the formula entered.

Escape works for me with one backslash.

A suggestion for additional avoidance of duplicates (if someone changes all files): If the name in the "Revised Filename" column is repeated - color it in red.

Last edited by BeckyEbook; 11-18-2019 at 02:51 PM.
BeckyEbook is offline   Reply With Quote
Old 11-18-2019, 02:55 PM   #222
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: 8,848
Karma: 6120478
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by BeckyEbook View Post
The first tests are very promising.
Strength in simplicity!

Only one thing - after pressing "Cancel" in the prior-revised window could return to the window with the formula entered.

Escape works for me with one backslash.
Hmm what about replacements groups? Does \1 work or do you need to use \\1

QRegularExpression docs seem to indicate we need to escape things. For example the only way to get a plain backslash is to use \\\\

As for returning to the RERenamer with the old string that is possible.

KevinH
KevinH is online now   Reply With Quote
Old 11-18-2019, 03:00 PM   #223
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 850
Karma: 3341026
Join Date: Jan 2017
Location: Poland
Device: Various
No problem.

ch01.xhtml
ch02.xhtml
ch03.xhtml

Find: ch(\d+)
Replace: chapter\1-blah

chapter01-blah.xhtml
chapter02-blah.xhtml
chapter03-blah.xhtml
BeckyEbook is offline   Reply With Quote
Old 11-18-2019, 03:15 PM   #224
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: 8,848
Karma: 6120478
Join Date: Nov 2009
Device: many
So I guess that makes sense as the text is never a literal string being processed by the compiler and is instead the output of a QLineEdit.

So I will edit my earlier post to the fix it.

Done.

I will work in setting the looping around and resetting the first Dialog with initial values.

Last edited by KevinH; 11-18-2019 at 03:17 PM.
KevinH is online now   Reply With Quote
Old 11-18-2019, 03:20 PM   #225
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: 31,098
Karma: 60358908
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 DiapDealer View Post
I don't think you appreciate what "failing" the renaming of a file in Sigil could entail. A mass rename is also a mass updating of all hrefs within the epub.

Way better in my opinion, to know before-hand whether there's potential problems and not let the user proceed with the mass rename if there is.
Got it!
I was thinking a fail was a rollback to before the task was invoked.
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
5.8.11 Pre=release knc1 Kindle Developer's Corner 21 04-17-2018 08:42 PM
Overdrive - Search for Pre-Release nynaevelan General Discussions 11 11-24-2013 02:27 PM
Where are the pre-release purchase buttons? Sydney's Mom General Discussions 8 09-06-2012 10:57 PM
KF Android 4.0 Pre-Release Version robertc88 Kindle Fire 22 01-22-2012 07:24 PM
PDF Viewer 0.3.0 pre-release pruss Android Devices 62 11-22-2011 11:18 AM


All times are GMT -4. The time now is 09:40 AM.


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