View Single Post
Old 03-01-2010, 04:49 AM   #10
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by kovidgoyal View Post
Another thing to be aware of is that this happens only if you use the run_plugins_on_import function in ui.py
This sounds like it might be my problem, as the module I'm trying to use in my plug-in is pure python source code, with appropriate __init__.py files.

My zip file has this structure (folders in italic):

myplugin_plugin_zip
....myplugin_plugin.py
....Module
........__init__.py
........Submodule1
............__init__.py
............variousscripts.py
...........OtherFolders
...............__init__.py
........Submodule2

etc.

My plugin sets these up:

name = 'myplugin'
description = 'myplugin description'
supported_platforms = ['linux', 'osx', 'windows']
author = 'me'
version = (5, 0, 0)
file_types = set(['epub'])
on_import = True


What do I need to do to get the run_plugins_on_import function to run?

Hmm... Better still, I have trimmed everything from the plug-in, except an import of a function from a module. I hope I've got it all right, but there's very little code there, so hopefully I have. I attach the plugin.

What's wrong with this plug-in? When trying to add it, I get the error message "No module named TestModule"

I'm sorry if I'm missing something basic here.
Attached Files
File Type: zip moduletest_plugin.zip (3.0 KB, 569 views)
pdurrant is offline   Reply With Quote