Clarify comment in plugin examples

This commit is contained in:
Kovid Goyal 2011-03-27 12:29:44 -06:00
parent 3bc6e7e9a6
commit cc219f774f
5 changed files with 12 additions and 11 deletions

View File

@ -112,7 +112,7 @@ ui.py
Now let's look at ui.py which defines the actual GUI plugin. The source code is heavily commented and should be self explanatory: Now let's look at ui.py which defines the actual GUI plugin. The source code is heavily commented and should be self explanatory:
.. literalinclude:: plugin_examples/interface_demo/ui.py .. literalinclude:: plugin_examples/interface_demo/ui.py
:lines: 10- :lines: 16-
main.py main.py
^^^^^^^^^ ^^^^^^^^^
@ -120,7 +120,7 @@ main.py
The actual logic to implement the Interface Plugin Demo dialog. The actual logic to implement the Interface Plugin Demo dialog.
.. literalinclude:: plugin_examples/interface_demo/main.py .. literalinclude:: plugin_examples/interface_demo/main.py
:lines: 10- :lines: 16-
Getting resources from the plugin zip file Getting resources from the plugin zip file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -19,7 +19,7 @@ class HelloWorld(FileTypePlugin):
version = (1, 0, 0) # The version number of this plugin version = (1, 0, 0) # The version number of this plugin
file_types = set(['epub', 'mobi']) # The file types that this plugin will be applied to file_types = set(['epub', 'mobi']) # The file types that this plugin will be applied to
on_postprocess = True # Run this plugin after conversion is complete on_postprocess = True # Run this plugin after conversion is complete
minimum_calibre_version = (0, 7, 51) minimum_calibre_version = (0, 7, 52)
def run(self, path_to_ebook): def run(self, path_to_ebook):
from calibre.ebooks.metadata.meta import get_metadata, set_metadata from calibre.ebooks.metadata.meta import get_metadata, set_metadata

View File

@ -25,7 +25,7 @@ class InterfacePluginDemo(InterfaceActionBase):
supported_platforms = ['windows', 'osx', 'linux'] supported_platforms = ['windows', 'osx', 'linux']
author = 'Kovid Goyal' author = 'Kovid Goyal'
version = (1, 0, 0) version = (1, 0, 0)
minimum_calibre_version = (0, 7, 51) minimum_calibre_version = (0, 7, 52)
#: This field defines the GUI plugin class that contains all the code #: This field defines the GUI plugin class that contains all the code
#: that actually does something. Its format is module_path:class_name #: that actually does something. Its format is module_path:class_name

View File

@ -7,14 +7,14 @@ __license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>' __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
from PyQt4.Qt import QDialog, QVBoxLayout, QPushButton, QMessageBox
if False: if False:
# This is here to keep my python error checker from complaining about # This is here to keep my python error checker from complaining about
# the builtin functions that will be defined by the plugin loading system # the builtin functions that will be defined by the plugin loading system
# You do not need this code in your plugins
get_icons = get_resources = None get_icons = get_resources = None
from PyQt4.Qt import QDialog, QVBoxLayout, QPushButton, QMessageBox
class DemoDialog(QDialog): class DemoDialog(QDialog):
def __init__(self, gui, icon): def __init__(self, gui, icon):

View File

@ -7,15 +7,16 @@ __license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>' __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
if False:
# This is here to keep my python error checker from complaining about
# the builtin functions that will be defined by the plugin loading system
# You do not need this code in your plugins
get_icons = get_resources = None
# The class that all interface action plugins must inherit from # The class that all interface action plugins must inherit from
from calibre.gui2.actions import InterfaceAction from calibre.gui2.actions import InterfaceAction
from calibre_plugins.interface_demo.main import DemoDialog from calibre_plugins.interface_demo.main import DemoDialog
if False:
# This is here to keep my python error checker from complaining about
# the builtin functions that will be defined by the plugin loading system
get_icons = get_resources = None
class InterfacePlugin(InterfaceAction): class InterfacePlugin(InterfaceAction):