11-04-2014, 06:08 PM | #1 |
actually it is /var/log
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) Code:
bk.addotherfile(os.path.basename(epub), data) But seeing my errors now, I withdraw this patch . Last edited by varlog; 11-22-2016 at 05:53 PM. |
11-06-2014, 06:23 PM | #2 |
actually it is /var/log
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. |
Advert | |
|
11-06-2014, 08:45 PM | #3 | |
Sigil Developer
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:
|
|
11-07-2014, 04:00 PM | #4 | |
actually it is /var/log
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
|
Quote:
And hey, I don't code in python. Never learned it. |
|
11-07-2014, 04:18 PM | #5 | |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Hi varlog,
Quote:
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 |
|
Advert | |
|
11-07-2014, 05:00 PM | #6 | |
actually it is /var/log
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
|
Quote:
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. |
|
11-09-2014, 03:11 PM | #7 |
actually it is /var/log
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 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. |
11-11-2014, 06:01 PM | #8 |
Sigil & calibre developer
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. |
11-12-2014, 07:14 PM | #9 |
actually it is /var/log
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. |
|
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 |