diff --git a/src/calibre/manual/creating_plugins.rst b/src/calibre/manual/creating_plugins.rst index 4667899d3b..0e1c4a51a9 100644 --- a/src/calibre/manual/creating_plugins.rst +++ b/src/calibre/manual/creating_plugins.rst @@ -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: .. literalinclude:: plugin_examples/interface_demo/ui.py - :lines: 10- + :lines: 16- main.py ^^^^^^^^^ @@ -120,7 +120,7 @@ main.py The actual logic to implement the Interface Plugin Demo dialog. .. literalinclude:: plugin_examples/interface_demo/main.py - :lines: 10- + :lines: 16- Getting resources from the plugin zip file ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/calibre/manual/plugin_examples/helloworld/__init__.py b/src/calibre/manual/plugin_examples/helloworld/__init__.py index 2cb3236b7b..b9b693d9a9 100644 --- a/src/calibre/manual/plugin_examples/helloworld/__init__.py +++ b/src/calibre/manual/plugin_examples/helloworld/__init__.py @@ -19,7 +19,7 @@ class HelloWorld(FileTypePlugin): 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 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): from calibre.ebooks.metadata.meta import get_metadata, set_metadata diff --git a/src/calibre/manual/plugin_examples/interface_demo/__init__.py b/src/calibre/manual/plugin_examples/interface_demo/__init__.py index dc33f4e427..aa9420b5c4 100644 --- a/src/calibre/manual/plugin_examples/interface_demo/__init__.py +++ b/src/calibre/manual/plugin_examples/interface_demo/__init__.py @@ -25,7 +25,7 @@ class InterfacePluginDemo(InterfaceActionBase): supported_platforms = ['windows', 'osx', 'linux'] author = 'Kovid Goyal' 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 #: that actually does something. Its format is module_path:class_name diff --git a/src/calibre/manual/plugin_examples/interface_demo/main.py b/src/calibre/manual/plugin_examples/interface_demo/main.py index de668799aa..53c9ae68dc 100644 --- a/src/calibre/manual/plugin_examples/interface_demo/main.py +++ b/src/calibre/manual/plugin_examples/interface_demo/main.py @@ -7,14 +7,14 @@ __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal ' __docformat__ = 'restructuredtext en' - -from PyQt4.Qt import QDialog, QVBoxLayout, QPushButton, QMessageBox - 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 +from PyQt4.Qt import QDialog, QVBoxLayout, QPushButton, QMessageBox + class DemoDialog(QDialog): def __init__(self, gui, icon): diff --git a/src/calibre/manual/plugin_examples/interface_demo/ui.py b/src/calibre/manual/plugin_examples/interface_demo/ui.py index b3535da925..3980291cc4 100644 --- a/src/calibre/manual/plugin_examples/interface_demo/ui.py +++ b/src/calibre/manual/plugin_examples/interface_demo/ui.py @@ -7,15 +7,16 @@ __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal ' __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 from calibre.gui2.actions import InterfaceAction 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):