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-04-2014, 06:08 PM   #1
varlog
actually it is /var/log
varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.
 
varlog's Avatar
 
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
Unofficial Sigil patches

This is a thread for unofficial Sigil patches.
The idea is to publish here patches which have not found the upstream but are useful (for some of us). I start with small patch which preserves file name for actions such as "Save As" when official Sigil names it just "untitled.epub". This patch makes Sigil remember name of the file even though it comes from plugin such as KindleImport.

To profit from this patch you have to change in said plugin (as of version 0.80.6) the line 192 in plugin.py from:
Code:
bk.addotherfile('dummy.epub', data)
to:
Code:
bk.addotherfile(os.path.basename(epub), data)
and some more.

But seeing my errors now, I withdraw this patch .

Last edited by varlog; 11-22-2016 at 05:53 PM.
varlog is offline   Reply With Quote
Old 11-06-2014, 06:23 PM   #2
varlog
actually it is /var/log
varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.
 
varlog's Avatar
 
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
Add text file to existing content

Sigil is able to open simple text file per menu "File->Open->Text files": it is converted into rudimentary .xhtml file. What I missed was an ability to add a simple text file to existing content. This patch provides such an ability.
I implemented it as an extra context menu "Add Existing Text Files..." (see image).
Implementation has no sanity checks and doesn't care about suffixes: it means you can add any file and Sigil will try to make simple xhtml text file from it. It is safe to add files with same name.

Disclaimer: it works for me, in my environment (Ubuntu 14.04, 64 bit) as designed, don't hold me responsible if it doesn't in yours. And I'm still not sure about concurrency...

Now, this is too old to be of any value now - so keep the servers happy I've removed this patch.

Last edited by varlog; 11-22-2016 at 05:53 PM.
varlog is offline   Reply With Quote
Advert
Old 11-06-2014, 08:45 PM   #3
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,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Hi,
I didn't see any pull requests for this one in user-nones tree. You should probably out of courtesy at least try that approach before posting them here where user-none may not see them.

Alternatively, you could easily implemented this one as a python edit plugin for Sigil where you could control how the text gets htmlized, where it gets added to the spine, etc, and then everyone could use it without need to rebuild their own patched copy from source. That was the whole point of adding the plugin structure.

Take care,

Kevin

Quote:
Originally Posted by varlog View Post
Sigil is able to open simple text file per menu "File->Open->Text files": it is converted into rudimentary .xhtml file. What I missed was an ability to add a simple text file to existing content. This patch provides such an ability.
I implemented it as an extra context menu "Add Existing Text Files..." (see image).
Implementation has no sanity checks and doesn't care about suffixes: it means you can add any file and Sigil will try to make simple xhtml text file from it. It is safe to add files with same name.

Disclaimer: it works for me, in my environment (Ubuntu 14.04, 64 bit) as designed, don't hold me responsible if it doesn't in yours. And I'm still not sure about concurrency...
KevinH is offline   Reply With Quote
Old 11-07-2014, 04:00 PM   #4
varlog
actually it is /var/log
varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.
 
varlog's Avatar
 
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
Quote:
Originally Posted by KevinH View Post
Hi,
I didn't see any pull requests for this one in user-nones tree. You should probably out of courtesy at least try that approach before posting them here where user-none may not see them.

Alternatively, you could easily implemented this one as a python edit plugin for Sigil where you could control how the text gets htmlized, where it gets added to the spine, etc, and then everyone could use it without need to rebuild their own patched copy from source. That was the whole point of adding the plugin structure.

Take care,

Kevin
Out of courtesy I don't submit patches that I know will be rejected. It is just a waste of time for all. On the other hand I find this functionality so cool that I just have to share .

And hey, I don't code in python. Never learned it.
varlog is offline   Reply With Quote
Old 11-07-2014, 04:18 PM   #5
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,156
Karma: 5450818
Join Date: Nov 2009
Device: many
Hi varlog,


Quote:
Originally Posted by varlog View Post
Out of courtesy I don't submit patches that I know will be rejected. It is just a waste of time for all. On the other hand I find this functionality so cool that I just have to share .
And hey, I don't code in python. Never learned it.
I don't understand ... how do you know your patch will be rejected without trying? Is it unsound in some way? Is there some evident problem? Does it cause an instability? If so, you probably should not be posting the patch at all.

If not, you should probably be submitting it for review via a pull request or by simply sending your patch to user-none. At worst, he says no, at best it gets included and helps others. He has included some of your patches in the past and has rejected others.

And in fairness to the ones he rejected, you did not do a very good job of explaining what the patch was for and why others might benefit. Simply saying "you need this but not explaining why or how others might benefit" is not a good way to get any patch accepted.

KevinH
KevinH is offline   Reply With Quote
Advert
Old 11-07-2014, 05:00 PM   #6
varlog
actually it is /var/log
varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.
 
varlog's Avatar
 
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
Quote:
Originally Posted by KevinH View Post

I don't understand ... how do you know your patch will be rejected without trying? Is it unsound in some way? Is there some evident problem? Does it cause an instability? If so, you probably should not be posting the patch at all.
I haven't noticed any problems or instabilities. The patch works exactly as I wanted it to - and, as long as it does, I won't be working on it. I have to have some time to use it .
To propose it upstream, with clear conscience, I will have to (as I see it) integrate it with "Add Existing Files" - which brings many problems and a lot of code with it. I know, because it was my first try.

In short: as far as I can judge the patch is sound but not elegant and generic enough for upstream. As the one who wrote it, I consider myself competent enough to judge it .

I hope it clears this issue.

Last edited by varlog; 11-07-2014 at 05:07 PM.
varlog is offline   Reply With Quote
Old 11-09-2014, 03:11 PM   #7
varlog
actually it is /var/log
varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.
 
varlog's Avatar
 
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
Using my addTex patch I encountered file names such as:
Code:
"What's up?": case #01... summary! .txt
which disabled Sigil's ability to generate functioning TOC: TOC was generated but did not function. I had to change manually file name in Book Browser section.
So after n-th case I did it: for internal Sigil use the characters in a file name are sanitized to posix portable subset, all the others are replaced with _ .
So much for not working on this patch anymore...
Uploaded new version to original post.

EDIT: Being a known file name freak I try to preserve as much as possible of an original name. So, for the case above, you will see in Text section:
Code:
_What_s_up____case__01..._summary__.xhtml

Last edited by varlog; 11-09-2014 at 03:53 PM.
varlog is offline   Reply With Quote
Old 11-11-2014, 06:01 PM   #8
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
@varlog, also, some of the patches proposed while rejected initially, I provided feed back on what was necessary to include as part of Sigil. Since the suggestions were not implemented and simply ignored I did not include the patches.

Basically, not everything will be included. If you want something included you need to make a case for it. Further, you need to take feed back and either provide an explanation as to why you don't agree with it or you need to make the requested changes so the changes are suitable for inclusion.
user_none is offline   Reply With Quote
Old 11-12-2014, 07:14 PM   #9
varlog
actually it is /var/log
varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.
 
varlog's Avatar
 
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
@user_none: Hey, I've understood you the first time around and accept it. Your work is appreciated, you should not waste time on trivia.
All I do in Sigil is for my own itch/pursuits. Being an open source fanatic I propose useful and generic things upstream, trying to keep the book as I understand it. Others, I'll keep for myself or, if it works wonders (oh oh, it works!) in my world, I'll try to publish elsewhere - because I'm open source fanatic .
And for more clarity:
1. After only about one year with C++/Qt I'm still not quite sure of myself most of the time.
2. Dry comments "because of designed" don't leave much space for discussion.
varlog is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unofficial 32-bit Legacy Windows Build DiapDealer Sigil 104 03-21-2019 01:15 AM
Unofficial Sigil Ubuntu-ish binary packages DiapDealer Sigil 92 07-17-2016 05:46 PM
Feature request: Update Patches kiwimonk Calibre 1 01-05-2011 02:09 PM
How to apply the enhancements/patches ? nubbol Calibre 2 09-05-2010 12:42 AM
iLiad Applying DR GTK+ patches to iLiad ericshliao iRex Developer's Corner 16 03-14-2010 06:39 AM


All times are GMT -4. The time now is 12:47 AM.


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