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 Yesterday, 08:07 AM   #1
Frogg
Junior Member
Frogg began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2025
Device: kobo
Error on kobo driver

Hi,

I'm "playing" with connexion on a Kobo with :
Code:
scanner = DeviceScanner()
scanner.scan()
device = KOBOTOUCH(None)
tmp = device.is_usb_connected(scanner.devices)
if tmp[0] != True:
    print("Kobo not find")
    exit()

print("Kobo find" + device.get_device_information())
I get the error :

Code:
  File "/usr/lib/calibre/calibre/devices/kobo/driver.py", line 1620, in get_device_information
    self.set_device_name()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/calibre/calibre/devices/kobo/driver.py", line 3912, in set_device_name
    if self.is2024Device():
       ~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/calibre/calibre/devices/kobo/driver.py", line 3742, in is2024Device
    return self.detected_device.idProduct in self.LIBRA_COLOR_PRODUCT_ID
           ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'KOBOTOUCH' object has no attribute 'detected_device'
Referring to :
Code:
    def is2024Device(self):
        return self.detected_device.idProduct in self.LIBRA_COLOR_PRODUCT_ID
But there is no self.detected_device = anywhere.
Do i miss something ?
Frogg is offline   Reply With Quote
Old Yesterday, 09:58 AM   #2
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: 45,449
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You need to call open() first.
kovidgoyal is offline   Reply With Quote
Advert
Old Yesterday, 11:12 AM   #3
Frogg
Junior Member
Frogg began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2025
Device: kobo
Hi,

thanks for your reply, but i don't get it (i use calibre-debug -e):

Code:
scanner = DeviceScanner()
scanner.scan()
device = KOBOTOUCH(None)
device.open(scanner.devices)
I get same problem

Code:
  File "/usr/lib/calibre/calibre/devices/usbms/device.py", line 504, in find_device_nodes
    detected_device = self.detected_device
                      ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'KOBOTOUCH' object has no attribute 'detected_device'
Frogg is offline   Reply With Quote
Old Yesterday, 11:24 AM   #4
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: 45,449
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look at the main() function in devices/cli.py for the exact sequence of operations you need.
kovidgoyal is offline   Reply With Quote
Old Yesterday, 01:38 PM   #5
Frogg
Junior Member
Frogg began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2025
Device: kobo
ok, it works, thx
its painfull, is there any full documentation or example for writing script ?

for example, i want to search book id in my library, it should be :

db.get_item_id(self, field, item_name, case_sensitive=False)

But there is no information about format of field or item_name, or what field cover. If i do :

db.get_item_id('authors', 'an_author')

i get the right id but if i do :

db.get_item_id('title', 'a_title')

using the title name from the .sql, it find nothing.

Last edited by Frogg; Yesterday at 01:42 PM.
Frogg is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clara HD - eReader-4.35.20400 Driver Error LordP Kobo Reader 4 06-05-2023 06:24 PM
Troubleshooting Kindle Driver Error Whenever Connected to PC madame_newbie Amazon Kindle 0 12-30-2018 10:30 PM
Kindle Driver Error When Connected to Calibre madame_newbie Devices 3 11-09-2018 05:40 AM
Kobo Touch driver error in 2.60 bernard.ryefield Devices 3 06-24-2016 08:16 AM
New Calibre Kobo Driver allows deleting of Kobo Free books timlegge Kobo Reader 46 08-27-2011 10:16 PM


All times are GMT -4. The time now is 05:40 PM.


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