Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-29-2010, 06:33 AM   #1
reader42
Zealot
reader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it is
 
Posts: 117
Karma: 2097
Join Date: Feb 2010
Device: none
Device plugin development

Hi,

is there any documentation about the device plugins? API etc.

And what do I have to so that calibre finds the plugin?
reader42 is offline   Reply With Quote
Old 03-29-2010, 06:40 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by reader42 View Post
Hi,

is there any documentation about the device plugins? API etc.

And what do I have to so that calibre finds the plugin?
The Calibre manual is a good place to start, try this section.
DoctorOhh is offline   Reply With Quote
Advert
Old 03-29-2010, 07:29 AM   #3
reader42
Zealot
reader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it is
 
Posts: 117
Karma: 2097
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by dwanthny View Post
The Calibre manual is a good place to start, try this section.
This is all about file type and metadata plugins, but nothing about devices.
I tried to install my plugin:
Code:
$ calibre-customize -a PB302.zip 
Traceback (most recent call last):
  File "/usr/bin/calibre-customize", line 16, in <module>
    sys.exit(main())
  File "/usr/lib/calibre/calibre/customize/ui.py", line 396, in main
    plugin = add_plugin(opts.add_plugin)
  File "/usr/lib/calibre/calibre/customize/ui.py", line 235, in add_plugin
    plugin = load_plugin(path_to_zip_file)
  File "/usr/lib/calibre/calibre/customize/ui.py", line 74, in load_plugin
    raise InvalidPlugin(_('No valid plugin found in ')+path_to_zip_file)
calibre.customize.ui.InvalidPlugin
I'm not sure if device plugins can be installed like this, because they are not base on calibre.customize.

I managed to get my plugin working, by adding it in calibre/customize/builtin.py but that does not seem to be the best way.
reader42 is offline   Reply With Quote
Old 03-29-2010, 07:42 AM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by reader42 View Post
I managed to get my plugin working, by adding it in calibre/customize/builtin.py but that does not seem to be the best way.
I have no experience in development I just pointed to the plugin area and associated API. Have you read through Setting up a calibre development environment? In the first section, Design philosophy, he talks about device plugins and points to where you can browse the built-in drivers.

Hopefully someone with experience will be by and point you in a direction that will help.

Last edited by DoctorOhh; 03-29-2010 at 07:48 AM.
DoctorOhh is offline   Reply With Quote
Old 03-29-2010, 09:43 AM   #5
reader42
Zealot
reader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it is
 
Posts: 117
Karma: 2097
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by dwanthny View Post
That's where I started. It shows the bulit-in, but does not say how to add new ones. Anyway, I got mine showing up and working, but I'm not shure if there is an easier/better way to add it than just adding it to the built-in.

Quote:
Originally Posted by dwanthny View Post
Hopefully someone with experience will be by and point you in a direction that will help.
I hope so too
I just got another question:
I don't like the way calibre puts each ebook in a subdir: "author/title/title-author.epub". If the book is no series, then it should be like this: "author/title-author.epub" and if it is a serie, it should be like this: "author/series/title-author.epub".
The first part is pretty easy, but unfortunatelly the second is not.
When the function upload_books() is called, it gets some metadata. Unfortunatelly the series is just one of the tags and not separate, so there is no way to find out which tag is the series.
reader42 is offline   Reply With Quote
Advert
Old 03-29-2010, 11:21 AM   #6
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: 30,443
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I am glad you only read series written by a single Author.
You don't need Calibre to manage such a simple series set at all.

And since you only read EPUB files, you don't have to worry about Multiple formats of the Same document, so you don't need a Title folder to hold them all.
theducks is offline   Reply With Quote
Old 03-29-2010, 11:35 AM   #7
reader42
Zealot
reader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it is
 
Posts: 117
Karma: 2097
Join Date: Feb 2010
Device: none
First: I like it some other way, so I try to change it. That's the good thing about open source. I'm not whining at somebody to change it for me.

Quote:
Originally Posted by theducks View Post
I am glad you only read series written by a single Author.
You don't need Calibre to manage such a simple series set at all.
No I don't. But tell me, why is the current path better for series with multiple authors? The files still end up in multiple directories.

Quote:
Originally Posted by theducks View Post
And since you only read EPUB files, you don't have to worry about Multiple formats of the Same document, so you don't need a Title folder to hold them all.
On my PC this folder per title has it's benefits and I don't want to change it there, but why would I need multiple formats on my ebook reader?
reader42 is offline   Reply With Quote
Old 03-29-2010, 11:38 AM   #8
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by reader42 View Post
That's where I started. It shows the bulit-in, but does not say how to add new ones. Anyway, I got mine showing up and working, but I'm not shure if there is an easier/better way to add it than just adding it to the built-in.
After you zip the .py file you go to preferences - plugins - and add your new plugin. Are you looking for something else? I have added new plugins here.

Quote:
Originally Posted by reader42 View Post
I just got another question:
You might want to start a new thread with this question so it gets the proper attention.
DoctorOhh is offline   Reply With Quote
Old 03-29-2010, 11:38 AM   #9
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Reader42: A question - are you talking about the oganization within the Calibre library on the ahrd disk or how they are stored on your Reader device? I am not sure from your posts!
itimpi is offline   Reply With Quote
Old 03-29-2010, 01:00 PM   #10
reader42
Zealot
reader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it isreader42 knows what time it is
 
Posts: 117
Karma: 2097
Join Date: Feb 2010
Device: none
I guess my posts where a bit confusing, I'll try again:

I want to write a plugin for my ebookreader (PB302), so I can use calibre to copy ebooks to my reader.

I used one of those as start and changed it.

Then I zipped it and tried to install it. With the gui I get no feedback. Using the command-line (calibre-customize), I get the error message shown above.

Then I copied the file to the folder, where all the built-in plugins are and added it in the calibre/customize/builtin.py. Now it works but I'm wondering if that is the prefered way to do this.

My next step is to change the way the directories are created on the reader. But maybe it is really better to discuss this in another thread.
reader42 is offline   Reply With Quote
Old 03-29-2010, 01:39 PM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,542
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You have to name the py file in the zip file ending with

_plugin.py
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DR800 Plugin development for DR800/DR1000 yuri_b iRex Developer's Corner 0 09-18-2010 10:46 AM
Device interface plugin - nook badmadbug Plugins 2 09-06-2010 12:03 PM
Difference between emulator and real device (developing uds plugin for djvu) luite iRex 7 03-03-2010 09:55 PM
iRex announces development of colour device for 2011 delivery HarryT News 57 06-09-2009 11:04 AM
Calibre plugin development - Newbie problems minstrel Plugins 5 04-12-2009 01:44 PM


All times are GMT -4. The time now is 05:35 AM.


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