Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 07-05-2021, 03:58 PM   #1
lizard-cooker
Junior Member
lizard-cooker began at the beginning.
 
lizard-cooker's Avatar
 
Posts: 7
Karma: 10
Join Date: Jul 2021
Location: Israel
Device: Kindle PaperWhite 3 (2015) WiFi
porting plugin to python3 help

Hello. I was looking into porting the Xray-creator plugin to python3. So far I have only tried to edit an import in it's ui.py file, that imports the now renamed httplib. I downloaded the plugin, unzipped it and changed that single line of code. Despite the minor change, when I try to load the plugin from file it now says:
calibre.customize.InvalidPlugin: The plugin in '/home/username/Downloads/xray_creator_calibre_plugin_3_2_1.zip' is invalid. It does not contain a top-level __init__.py file
even though the plugin clearly contains one, and when I try to load the original plugin it does not give such error.
What could I possibly be missing?
lizard-cooker is offline   Reply With Quote
Old 07-05-2021, 05:44 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,714
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Moderator Notice

Did you try looking through this thread ==>> Attn plugin devs: porting to python 3

And I'll move this to the Development subforum

BR
BetterRed is offline   Reply With Quote
Advert
Old 07-05-2021, 09:20 PM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
The usual reason for that is zipping up the plugin incorrectly. You probably have zipped up the files so that the plugin files are in a directory inside the zip file, rather than them being in the top level.

Alternatively, it is exactly as the error said and you are missing the "__init__.py" file.

For either of these, if you look at the structure of the current version of the file, you should be able to see what is wrong. Otherwise, post your copy in the thread and we can look at it.
davidfor is offline   Reply With Quote
Old 07-05-2021, 10:25 PM   #4
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 7,065
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by lizard-cooker View Post
Hello. I was looking into porting the Xray-creator plugin to python3.
FYI the WordDumb plugin can create X-ray files and already supports Python 3.
jhowell is online now   Reply With Quote
Old 07-06-2021, 04:22 AM   #5
lizard-cooker
Junior Member
lizard-cooker began at the beginning.
 
lizard-cooker's Avatar
 
Posts: 7
Karma: 10
Join Date: Jul 2021
Location: Israel
Device: Kindle PaperWhite 3 (2015) WiFi
Quote:
Originally Posted by davidfor View Post
The usual reason for that is zipping up the plugin incorrectly. You probably have zipped up the files so that the plugin files are in a directory inside the zip file, rather than them being in the top level.

Alternatively, it is exactly as the error said and you are missing the "__init__.py" file.

For either of these, if you look at the structure of the current version of the file, you should be able to see what is wrong. Otherwise, post your copy in the thread and we can look at it.
that you! this worked!
lizard-cooker is offline   Reply With Quote
Advert
Old 07-06-2021, 04:36 AM   #6
lizard-cooker
Junior Member
lizard-cooker began at the beginning.
 
lizard-cooker's Avatar
 
Posts: 7
Karma: 10
Join Date: Jul 2021
Location: Israel
Device: Kindle PaperWhite 3 (2015) WiFi
Quote:
Originally Posted by jhowell View Post
FYI the WordDumb plugin can create X-ray files and already supports Python 3.
I know... but it doesn't work for me :/
lizard-cooker is offline   Reply With Quote
Reply

Tags
de\\


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Attn plugin devs: porting to python 3 kovidgoyal Plugins 129 06-16-2020 01:31 AM
Developing plugins (python3) rigogsilva Development 7 05-20-2020 10:04 PM
python3 plugins? Claghorn Plugins 4 11-12-2019 07:57 PM
Aura How to install python3 in Kobo Aura? guchai25 Kobo Reader 0 11-12-2019 09:41 AM
Python3 on Aura One Kristoffer_1 Kobo Developer's Corner 5 07-06-2019 06:20 PM


All times are GMT -4. The time now is 06:03 PM.


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