![]() |
Okay, Please give RemoveInLineStyles_v030.zip a try. It is attached to the first post in this thread.
It requires at least Sigil-1.0 to work but should properly handle any epub layout. |
The new version doesn't seem to work:
Code:
Traceback (most recent call last): |
It should fail given the path is outside the epub: 'C:\\sgc_styles.css'
Are you trying to create the css file outside the epub? Or is this some strange Windows path issue. It worked just fine on macOS when I tried it. Hmmm... Something is very strange. |
Please try adding an existing css file to your epub just temporarily.
What is its resulting book path (mouse over the added css file in BookBrowser to see its full book path). Try then running the plugin. The plugin should put the file right beside the existing css file you added temporarily? Did it or does the plugin still generate an error? If so move the temporarily added css file into a "Styles" folder and try the plugin once again. What errors does it generate? If you have an epub that you can generate the error with, would you please post it someplace private (unless it is public domain) and pm me (KevinH) here onMobileread with a private link so that I can try to reproduce what settings are causing the plugin to write something to your root directory instead of to your epub plugin output folder. |
By any chance is your epub an epub2 with no OEBPS folder and no existing stylesheets?
|
It is added to the root folder. It is a flat EPUB3 file with existing stylesheets.
The generated stylesheet was successfully added after the existing stylesheets were moved into Styles subfolder. |
If it has existing stylesheets, are they all stored in the root of the epub? Or are some css stored in a different place?
The addbookpath routine literally prepends the path to the plugin working directory to the file path built from its book path. This simply can not be at the root level of the C drive. As the plugin's work directory is created in temp with a unique path. I will create an epub3 that is flat with no organizing or grouping folders but with a existing css file at the root level of the epub to see if I can recreate what you are seeing. Is there anything else unique about your test epub? |
Okay, I think I can see how no folder at all could cause an issue for my plugin code but not the exact one you are seeing. But perhaps it is related. So give me a day or two and I will post a revised v031 version for you to try. Hopefully it will prevent the issue you are seeing as well.
|
That can happen if you append an absolute path starting with \ or /.
|
But I prepend a outdir to it. Would you feel comfortable hand editing the plugin.py in a text editor and trying to see if this fixes the issue. If so, here is what I would like you to try if possible:
Near line 70 in plugin.py you will see the following: Code:
css_new_filename = unique_filename('sgc_styles.css', namelist)Code:
css_new_filename = unique_filename('sgc_styles.css', namelist)And notice the test for non-empty default style_folder to prevent starting with "/" in the book path. The spacing for the indent is 4 spaces in case it gets messed up by the post. If you could try that and let me know if it works. If it does I will make an official new release with that change in place. If you do not feel comfortable editing python code, just let me know and I will try to build something for you to test. I have just been so tied up with the new Sigil release. I apologize for the delay. |
I made the change just in case. Please give this one a try before I make an official new release.
I have my fingers crossed! [Attachment removed - see the first post in this thread for the plugin zip archive] |
It seems to work correctly.
|
Quote:
I will make v031 the official release once I get back to my desktop machine. KevinH ps. It is now uploaded to the first post in this thread. |
| All times are GMT -4. The time now is 08:24 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.