![]() |
#1 |
Connoisseur
![]() ![]() Posts: 91
Karma: 108
Join Date: Jan 2008
Device: Palm Treo 680, Sony Reader
|
![]()
So, I'm working on a plugin to automate generating HTML from a PDB that is specially-suited for the Sony PRS-500 LRF format(don't ask, my Mom refuses to send hers in for an upgrade for fear of losing it). I already have the scripts that do this, but they are broken into separate files and reference each other with the "import" command.
However, once I zip them up into a plugin, the import fails. The main function is called, but it can't find the other files. Originally, I just did: "import filename" since they were in the same folder. How should I reference these files so they can be found within the plugin? I'd hate to have to try and mash them all together into a single file. - Jim |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,144
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
the plugin system will give your plugin a path to the zip file in self.plugin_path. You can just add that to sys.path like this
Code:
sys.path.insert(0, self.plugin_path) |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error importing mobi files | Nomadin | Calibre | 27 | 02-19-2010 04:15 AM |
Importing HTML Files | Shadowlane | Calibre | 1 | 12-19-2009 03:04 PM |
Importing files onto a Kindle | Dahak | Amazon Kindle | 7 | 05-19-2009 12:12 AM |
Error when importing MobiPocket files. | mbovenka | Calibre | 7 | 08-16-2008 10:07 AM |
Kindle Browser and local files | slm | Amazon Kindle | 2 | 06-03-2008 08:29 PM |